User Login View command
W
Meaning: As simple as this, a letter W is a command. View logged-in user information.
Meaning of the result of the output:
Username for user Login
TTY Login Terminal
from which IP address to log in
[Email protected] Login time
Idle User Inactivity Time
JCPU refers to the time taken by all processes connected to the terminal, and this time does not include the past background
Job time, but includes the time taken by the currently running background job
PCPU the time that the current process takes
What is the command that is currently running
Consider a practical example, as follows:
This indicates that there are currently two logged-in users, both root. One is logged on natively (that is, tty1) and one is Telnet (that is, pts/0).
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
W.H.O.
Meaning: This command is also very simple, just a word. The same is to view the current logged-on user, but only to display less information.
The results of the output are: User name, login terminal, logon time.
Take a look at the actual, as follows:
Note that only some of the information is displayed when compared to the W command.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Querying user information for current login and past logins
Last
Meaning: The command is also very simple, a word. Queries the system for past logins and current logged-in user information.
Note: The last command reads the data from the/var/log/wtmp file by default, so be aware that this file cannot be viewed with VI.
The output of the command includes: User name, login terminal, login IP, logon time, exit time (online time)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
View the last logon time for all users
Lastlog
Meaning: The command is also very simple, a word. View the last logon time for all users of the system
Note: The Lastlog command reads the data/var/log/wtmp this file by default, so be aware that this file cannot be viewed with VI.
Command output includes: User name, login terminal, login IP, last login time
(ix) Linux view commands for user login