Today is a good day to learn how to take a look at logged in users. The vast majority of my readers are desktop users, so you can mostly skip this article. On the other hand, when you take a look at logged in users, you might find users you didn’t know were logged in and discover a problem like unknown users.
Yeah, most of you – including me at the moment (which makes it difficult to do things like take useful screenshots) are using Linux (mostly) as a single user. You have a user and you login to that user account when you start your system up.
While you do have other system-configured users, you don’t generally login as those users. As such, you probably spend very little time thinking about the users you have. Those system users aren’t generally logged in but are there for permissions purposes, so they’re out of mind for most of us.
Well, for the rest of you, you can use this article to learn how look logged in users – even getting a glimpse at what they’re doing. I mentioned some difficulty in taking screenshots, so I’ll provide you with just one. Cherish it, as it’s the only one you’re getting!
Here it is:
Have A Look At Logged In Users:
This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press
As you can see from the image above you can see all the logged in users with the first command. The following command will list them:
You’ll see the same thing, with a bit more information, when you use the following command:
Now, in the image above, you can see where I used it once and then ran it again. What you don’t see is that, in between those two commands, I opened up another TTY and logged in again as ‘kgiii’. If you want to replicate that, just press
Finally, you can get a look at what they’re doing – like one has a desktop session open and two of those login instances just have bash sessions open in TTY sessions. To do that, you just use:
That should be easy enough for you to remember! By the way, if you did login as an additional TTY instance, run ‘
users‘ again and you’ll see the output for that command has changed accordingly. The command’s output will may also give you a good idea about how long the system has been up and what the system resources are like.
There you have it. You have learned how to have a look at logged in users so that you can have an idea of what’s going on with your system. If you spot a user you don’t recognize, that might be indicative of a problem. If you spot a user you don’t recognize, you’ll need to do some more investigating. By the way, if you have ‘finger’ installed you can always run ‘