A
user can also change the password with the passwd command. The following
example demonstrates the process of changing the password by the user, cappi:
[cappi@localhost
~]$ passwd
Changing
password for user cappi.
Changing
password for cappi.
(current)
UNIX password:
[user enters old password here]
New
password: [user
enters new password here]
Retype
new password:
[user re-enters new password here]
passwd:
all authentication tokens updated successfully
[cappi@localhost ~]$ _
To make sure that only the authorized user is attempting to change the password, the passwd command requests the previous password. Linux displays an error notice,
Passwd: Authentication token manipulation error, and the Linux prompt appears on the screen if it is unable to recognize the old password, as demonstrated in the following example:
[cappi@localhost
~]$ passwd
Changing
password for user cappi.
Changing
password for cappi.
(current)
UNIX password: [user
enters the wrong password]
passwd: Authentication token manipulation error
[cappi@localhost
~] $
UNIX
asks for retyping a new password. If the passwords do not match, UNIX displays
an error message, Sorry, passwords do not match and asks to retype the new
password. This is shown in the following example:
[cappi@localhost
~]$ passwd
Changing
password for user cappi.
Changing
password for cappi.
(current)
UNIX password:
New
password: [user
enters a new password]
Retype
new password:
[user enters the old password]
Sorry,
passwords do not match. [user
enters the wrong new password]
New
password: _
[root@localhost
~]# passwd cappi
Changing
password for user cappi.
New
password: [the
root user enters a new password]
Retype
new password:
[the root user re-enters the new password]
passwd: all authentication tokens updated successfully.
VIEWING THE SYSTEM DATE AND TIME
Users
can display the current date and time by using the date command. The following
example demonstrates the date command:
[cappi@localhost
~]$ date
Thu
OCT 24 15:56:21 IST 2013
[cappi@localhost ~] $ _
The
options of the date command can be used to format the date and time before
displaying them.
The
options are specified within double quotes and they must begin with a + symbol.
the
month, day, and time in hours and seconds can be referred, to as shown in the
following table.
OPTION |
DESCRIPTION |
%m |
Displays month of the year (in digits) |
%d |
Displays day of the month (in digits) |
%y |
Displays year (last two digits) |
%D |
Displays date as mm/dd/yy |
%H |
Displays hour (00 to 23) |
%M |
Displays minutes (00 to 59) |
%S |
Displays seconds (00 to 59) |
%T |
Displays time as HH.MM.SS |
%a |
Displays abbreviated weekdays (Sun to Sat) |
%h |
Displays abbreviated month (Jan to Dec) |
%r |
Displays time in the AM/PM notation |
The following example demonstrates the date command along with its options:
[cappi@localhost
~]$ date "+%T"
11:22:45
[cappi@client1
~]$ date "+%y"
13
The
following example demonstrates messages included within the date command:
[cappi@localhost
~]$ date "+DATE : %D"
DATE:
10/24/13
The
terminal window screen can be modified by using the following commands:
clear:
It is used to clear the terminal screen.
tput
clear: It clears the standard output device, and the screen, and positions the
cursor at the top left corner of the screen.
tput
cup: It is followed by the screen coordinates and positions the cursor at the
specified row and column. The following example will position the cursor at row
15 and column 20:
tput
cup 15 20
tput
smso: It sets the screen to reverse video.
tput
rmso: It sets the screen back to normal.
tput
blink: It displays a blinking output. Note that this option may not work on a
Telnet session.
tput
reset: It resets the screen back to the default settings.
IDENTIFYING THE CURRENT USERS WORKING ON THE SYSTEM
The
who command is used to display the names of all users who are currently
logged in the following example demonstrates the who command:
- Login name
- Terminal type and number
- Date and time when logged in
- The remote hostname of the terminal from where the user has logged in. Note that this is shown only for users who have not logged in from the server.
The Who am I command displays the name of the current user logged in. The following example demonstrates the who am I command:
- -m = displays the name of the current user logged in. It is the same as who am i.
- -q = prints only the login names and the numbers of users logged in.
So that’s it for today guys if you
want to learn more about Linux OS follow and stay tuned with guerillateck.com
Thanks for learning give us your feed
back?
Identifying the basics of linux part 3
coming soon
No comments:
Post a Comment