Find out who’s using your system with these Linux tools

Determining who has logged into the system is very simple. You can find out by using a couple of small utilities. The easiest to use is the who command, which displays who currently has logged in and from where.

Here’s an example:

$ who
root   tty1   Jul 24 10:13
joe           pts/0 Aug 1 14:17 (somehost.com)

This shows you that root has logged in on the first tty (console). It also shows that joe has logged in via ssh, connecting from the machine “somehost.com.” It also indicates the time when these users logged in.

Another useful tool is the last command, which provides information about when a user last connected to the system. Like the who command, the last command returns the username, where they connected, and when they logged in. It also tells you when they logged out or if they’re still connected.

Here’s an example:

$ last
joe           pts/0  somehost.com Sun Aug 1 14:17     still logged in

Keeping track of who’s been using your computer couldn’t be easier using these two command-line tools.