w
Synopsis
w
Example
The following example show that 2 users (
root and Jane) is logged in from ip 192.168.139.1 . IDLE column below
show that the idle time (no activities from user's keyboard)
#
w
21:34:24 up 34 min, 2 users, load average: 0.00, 0.00, 0.02
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root pts/1 192.168.139.1 21:08 0.00s 0.18s 0.00s w
jane pts/2 192.168.139.1 21:33 9.00s 0.08s 0.03s vim /var/log/maillog
|
You can also use 'who' to show the similar user
information.
who
Synopsis
who [options]
|
Options |
Description |
| -a, --all |
same as -b -d --login -p -r -t
-T -u |
| -H, --heading |
print line of column headings |
| -l, --login |
print system login processes |
| -q, --count |
all login names and number of users logged on |
| -s, --short |
print only name, line, and time (default) |
Example
#who -H -a
NAME LINE TIME IDLE PID COMMENT EXIT
Apr 28 21:02 432 id=si term=0 exit=0
system boot Apr 28 21:02
run-level 5 Apr 28 21:02 last=S
Apr 28 21:03 2568 id=l5 term=0 exit=0
Apr 28 21:03 3427 id=1
LOGIN tty2 Apr 28 21:03 3513 id=2
Apr 28 21:03 3514 id=3
LOGIN tty4 Apr 28 21:03 3605 id=4
Apr 28 21:03 3606 id=5
Apr 28 21:03 3872 id=6
Apr 28 21:03 3989 id=x
LOGIN tty5 Apr 28 21:03 3606 id=5
root + pts/1 Apr 28 21:08 . 4491 (192.168.139.1)
jane + pts/2 Apr 28 21:33 00:21 4649 (192.168.139.1)
#who -s
root pts/1 Apr 28 21:08 (192.168.139.1)
jane pts/2 Apr 28 21:33 (192.168.139.1)
#who -l
LOGIN tty2 Apr 28 21:03 3513 id=2
LOGIN tty4 Apr 28 21:03 3605 id=4
LOGIN tty5 Apr 28 21:03 3606 id=5
|
|