General Purpose Commands
To study and execute Unix
commands.
|
Command
|
Function
|
|
|
date
|
Used to display the current system date and
time.
|
|
|
|
|
|
|
date
+%D
|
Displays date only
|
|
|
|
|
|
|
date
+%T
|
Displays time only
|
|
|
|
|
|
|
date
+% Y
|
Displays the year part of date
|
|
|
|
|
|
|
date
+% H
|
Displays the hour part of time
|
|
|
|
|
|
|
cal
|
Calendar of the current month
|
|
|
|
|
|
|
cal year
|
Displays calendar for all months of the
specified year
|
|
|
|
|
|
|
cal month year
|
Displays calendar for the specified month of
the year
|
|
|
|
|
|
|
who
|
Login details of all users such as their IP,
Terminal No, User name,
|
|
|
|
|
|
|
who
am i
|
Used to display the login details of the user
|
|
|
tty
|
Used to display the terminal name
|
|
|
|
|
|
|
uname
|
Displays the Operating System
|
|
|
|
|
|
|
uname
-r
|
Shows version number of the OS (kernel).
|
|
|
|
|
|
|
uname
-n
|
Displays domain name of the server
|
|
|
|
|
|
|
echo
"txt"
|
Displays the given text on the screen
|
|
|
|
|
|
|
echo
$HOME
|
Displays the user's home directory
|
|
|
|
|
|
|
|
|
|
|
man cmdname
|
Manual for the given command. Press q to
exit
|
|
|
|
|
|
|
|
|
|
|
exit
|
Exit from a process. If shell is the only
process then logs out
|
|
|
|
|
|
[staff
|
staff]$
|
date
|
|
|
Sat Apr
|
9 13:03:47
IST 2011
|
|
|
[staff
staff]$ date +%D
04/09/11
[staff
staff]$ date +%T
13:05:33
[staff
staff]$ date +%Y
2011
[staff
staff]$ date +%H
13
|
[staff
|
staff]$
|
cal
|
|||||
|
|
|
April 2011
|
|
|
|
||
|
Su
|
Mo Tu
|
We
|
Th
|
Fr
|
Sa
|
|
|
|
|
|
|
|
|
1
|
2
|
|
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
|
|
10
|
11 12 13
14 15 16
|
|
|||||
|
17
|
18 19 20
21 22 23
|
|
|||||
|
24
|
25 26 27
28 29 30
|
|
|||||
|
[staff
|
staff]$
|
cal
|
1800
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
1800
|
|
|
|
|
|
|
|
|
|
|
|
January
|
|
|
|
|
February
|
|
|
|
|
|
March
|
|
|
|
|||
|
Su Mo
Tu We Th
Fr Sa
|
Su Mo
Tu We Th
Fr Sa
|
|
Su Mo
Tu We Th
Fr Sa
|
|
|||||||||||||
|
1
|
2
|
3
|
4
|
|
|
|
|
|
|
1
|
|
|
|
|
|
|
1
|
|
5 6 7
8
|
9 10
11
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
||
|
12 13
14 15 16
17 18
|
9 10
11 12 13
14 15
|
|
9 10
11 12 13
14 15
|
|
|||||||||||||
|
19 20
21 22 23
24 25
|
16 17
18 19 20
21 22
|
|
16 17
18 19 20
21 22
|
|
|||||||||||||
|
26 27
28 29 30
31
|
|
23 24
25 26 27
28
|
|
|
23 24
25 26 27
28 29
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
30 31
|
|
|
|
|
|
|
|
…
|
|
|
|
|
|
|
…
|
|
|
|
|
|
|
…
|
|
|
|
|
| |||||||||||||||||