WHO(1) | General Commands Manual | WHO(1) |
who
— display who
is on the system
who |
[-abHmqsTu ] [am I ]
[file] |
The who
utility displays information about
currently logged in users. By default, this includes the login name, tty
name, date and time of login and remote hostname if not local.
The options are as follows:
-a
-bTu
, with the exception that output
is not restricted to the time and date of the last system reboot.-b
-H
-m
-q
-s
-T
-u
.
’ if the user has been idle less
than a minute, and “old
” if the user
has been idle more than 24 hours.am
I
-m
.By default, who
gathers information from
the file /var/run/utmpx. An alternate
file may be specified which is usually
/var/log/utx.log (or
/var/log/utx.log.[0-6] depending on site policy as
utx.log can grow quite large and daily versions may
or may not be kept around after compression by
ac(8)). The utx.log
file contains a record of every login, logout, crash, shutdown and date
change since utx.log was last truncated or
created.
If /var/log/utx.log is being used as the file, the user name may be empty or one of the special characters '|', '}' and '~'. Logouts produce an output line without any user name. For more information on the special characters, see getutxent(3).
The COLUMNS
, LANG
,
LC_ALL
and LC_TIME
environment variables affect the execution of who
as
described in environ(7).
The who
utility exits 0 on success,
and >0 if an error occurs.
Show a brief summary of who is logged in:
$ who -q fernape root root # users = 3
Show who is logged in along with the line and time fields (without the headers):
$ who -s fernape ttyv0 Aug 26 16:23 root ttyv1 Aug 26 16:23 root ttyv2 Aug 26 16:23
Show information about the terminal attached to standard input:
$ who am i fernape Aug 26 16:24
Show time and date of the last system reboot, whether the users accept messages and the idle time for each of them:
$ who -a - system boot Aug 26 16:23 . fernape - ttyv0 Aug 26 16:23 . root - ttyv1 Aug 26 16:23 . root - ttyv2 Aug 26 16:23 .
Same as above but showing headers:
$ who -aH NAME S LINE TIME IDLE FROM - system boot Aug 26 16:23 . fernape - ttyv0 Aug 26 16:23 . root - ttyv1 Aug 26 16:23 00:01 root - ttyv2 Aug 26 16:23 00:01
The who
utility conforms to
IEEE Std 1003.1-2001 (“POSIX.1”).
A who
command appeared in
Version 1 AT&T UNIX.
August 30, 2020 | macOS 15.0 |