View currently logged in users
w command
who command
View information about currently logged in and past logged in users
last command
By default, the /var/log/wtmp file data is read. This is a binary file to prevent human changes. It cannot be viewed with vi, but can only be viewed with the last command.
lastlog command //View the login status of all users
The default read is the /var/log/lastlog file, which is also a binary file and can only be viewed with the lastlog command.