Sunday, November 13, 2011

The who command

The who command lists the login names of everyone currently working on your system. the tty designation refer to the special files that correspond to each user's terminal. The date and time at which each user logged in are also shown.

Syntax:
        who[-uTlHqpdbrtas] [file]
        who -qn x[file]
        who am i
        who am I

The who command can list the user's name,terminal line,login time,elapsed time since activity occured on the line and the process-ID of the command interpreter(shell) for each current unix system user. It examines the   /var/adm/utmp  file to obtain its information.If file  is given , that file, is examined. 

The am i or am I  option identifies the user invoking the who command.

The general format for output is:
name [state] line time [idle] [pid] [comment] [exit]

The name,line and time information is produced by all options except -q. The state information is produced only by -T; only u and -l produce the idle and pid information; and the comment and exit information is produced only by -a. With options who can list logins , logoffs, reboots and  changes  to the system clock, as well as other processes  generated by the init process.
The  options  will be discussed in the next post.

No comments:

Post a Comment