Several commands can be used to identify and monitor users:
id(1M)— Displays the real and effective User ID (UID) and Group ID (GID)
finger(1)— Displays information about local and remote users
last(1)— Displays who logged into the system and when, who is still logged in, and who logged out and when
who(1) and w(1)— Display the users currently logged into the system
whodo(1M)— Displays who is doing what
The id command is used to display the real and effective UID and GID for the invoking process or specified user account. If invoked with -a as an option, all groups in which the user ID is a member will be returned. The following listing shows the results of executing the id command:
# id -a uid=0(root) ...