Академический Документы
Профессиональный Документы
Культура Документы
19
13:28:34
IST
2005
Date is a valid command, and it displays both the date and time. Notice another security
feature of UNIX; the command doesnt prompt you to change either the date or time. This
facility is available only to the administrator, and the strange thing is that he uses the same
command.
(2) ls
This command is used see the list of files and directory at current location or specified
path. This command supports us to see the list of file and directory.
Syntax:
$ls [-Option] [Path]
Options:
x
-F
-a
-R
-r
-1
-l
-d
-t
-lt
-u
-lu
-lut
-i
Multicolumn output
Marks executable with * directories with / and symbolic links with @
Show all filenames beginning with a dot including . and ..
Recursive list
Sorts filenames in reverse order (ASCII collating sequence by default)
One filename in each line
Long listing in ASCII collating sequence showing seven attributes of a file
List only directory
Sorts filenames by last modification time
Sorts filenames listing by last modification time
Sorts filenames by last access time
Sort by ASCII collating sequence but listing shows last access time
As above but sorted by last access time
Display inode number
(3) Who
This command is used to get information about users (including yourself), you can use
several commands. The who command reports on users who are presently logged in. The who
command normally reports certain information about logged-in users. By using its options, you
can specify that it report information about the processes initiated by init, and that it report
reboots changes to the system clock, and logoffs. If you invoke who with no option or argument,
you get the following output:
Syntax:
$who
Output:
Username
Username
Option
tty00 Date
tty01 Date
-u
this option is used to see time since the last activity (idle time) and the process ID
number for each logged-in user. A process ID number is an integer number assigned by UNIX
to uniquely identify a given process.
Example
$who u
Output
Username
Username
tty00
tty01
Date
Date
Process No.
Process No.
-q
This option is used to shows login IDs and a count of the logged-in users q stands for
quick.
Example
$who q
Output
User Name
User Name
#Users = 2
Terminal Name
Terminal Name
3(A) who am i
Sometime we logged in from several terminals under different accounts, and we forget
that which username or terminal name we are using at that time this command is useful to know
username and terminal name.
Syntex:
$who am i
Output
User Name
Terminal Name
(4) Cal
Cal is a handy tools that you can invoke any time to see the calendar of any specific
moth, or a complete year. To see the calendar for the month of July 2009, provide the month
number and year as the two argument to cal:
Syntax
$cal [Month Number Year]
Month Number Year
This option will show you the calendar for the particular month of particular year. To see
the Aug 2009 calendar then following command will be invoked.
$cal 8 2009
Above command will show you the calendar for the month of august 2009.
User can see also all year calendar for the particular year for that user has to write year
number after cal command.
Example
$cal
2009
Above command will show you 12month calendar for the year of 2009.
With cal, you can produce the calendar for any month or year between the year 1 and
9999. This should serve our requirements.
(5) ps (Process Status)
Displays status of current running processes. By default, it shows process ID, terminal
with which process is associated, time consumed by the process since it has been started and
process name (generally command name or program name).
Syntax
$ps [Option]
-f
-e or A
-u
-l
-t
Example
$ps
Full listing showing the PPID (Parent Process ID) of each process
All processes including user and system processes
Process of user usr only
Long listing showing memory-related information
Processes running on terminal term, (say /dev/console)
TT
tty10
tty10
TIME
0
0
COMMAND
ksh.exe
ps.exe
Example
A file abc.txt having following data
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
$ wc abc.txt
Output
20
42
abc.txt