home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

UNIX in a Nutshell: System V Edition

UNIX in a Nutshell: System V EditionSearch this book
Previous: Reference: which Chapter 2
UNIX Commands
Next: Reference: whoami





] [



Display information about the current status of the system. With no options, list the names of users currently logged in to the system. An optional system file (default is /var/adm/utmp ) can be supplied to give additional information. who is usually invoked without options, but useful options include am I and -u . For more examples, see cut , line , paste , tee , and wc .



Use all options.


Report information about the last reboot.


Report expired processes.


Print headings.


Report inactive terminal lines.

-n x

Display x users per line (works only with -q ).


Report previously spawned processes.


"Quick." Display only the usernames.


Report the run level.


List the name, line, and time fields (the default behavior).


Report the last change of the system clock (via date ).


Report whether terminals are writable (+), not writable (-), or unknown (?).


Report terminal usage (idle time). A dot (.) means less than one minute idle; old means more than 24 hours idle.

am i

Print the username of the invoking user.


This sample output was produced at 8 a.m. on April 17:

who -uH

martha  ttyp3  Apr 16 08:14 16:25  2240   
george  ttyp0  Apr 17 07:33   .   15182

Since martha has been idle since yesterday afternoon (16 hours), it appears that Martha isn't at work yet. She simply left herself logged in. George's terminal is currently in use.

Previous: Reference: which UNIX in a Nutshell: System V Edition Next: Reference: whoami
Reference: which Book Index Reference: whoami

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System