who Command in Linux / Ubuntu

who command used to displays the information about logged-in users, when the system has booted last time on Linux operating system.

Syntax: who [options] [filename]

who Command in Linux with Examples

1.To display the information (login name) about current logged-in users, use who command in terminal.

By default who command displays the following information about any logged-in user

  • Login name of the user
  • Date and time of recently logged-in users into system
  • Remote hostname of the user
who

              who Command in Linux

2. To display all the information about currently logged-in users, use who -a command in terminal. You can also use who –all command in terminal.

who -a
who --all

who -a command in Linux

3. To display the whole list of logged-in user, Use who -u command in Terminal.

who -u

who -u Command in Linux

4. To display logged-in user username use whoami command.

whoami

whoami Command in Linux

5. To display the list of all logged-in user and their activities, use w command.

w

w Command in Linux

6. To display user identification information, use “id” command.

id

id Command in Linux

7. To display information about the logged-in users and host associated with it, use “-m” option with who command.

who -m -H

who -m -H Command in Linux

8. To display the information about all active process

who -p -H

who -p -H Command in Linux

9. To display status of the users message as +, – or ? , Use who -T command.

who -T -H

who -T -H Command in Linux

10. To display the number of currently logged-in users with their login name (username), Use who -q command in terminal.

who -q -H

who -q -H Command in Linux

11. To display system login process,  use “-l” option with who command.

who -l -H

who -l -H Command in Linux

12. To display the list of all dead processes, Use who -d, who –dead command in terminal. Use who -d -H for human-readable format.

who -d -H

who -d -H Command in Linux

13. To display the time of last system boot. Use who -b, who –boot command in terminal. For human-readable format use who -b -H command.

who -b -H

who -b -H Command in Linux