December 3, 201312 yr A common question is how to find out who is currently logged into the unix/linux server as well as past users who were logged in and then logged out. Basically, we want to know what is going on with our servers. Find out who currently is logged in you can run a couple of commands. My most used command to find who is currently logged in is: dhosang@usrn2netweb01:~$ sudo whorfrick pts/0 2013-12-03 09:22 (10.6.5.224)pmack pts/1 2013-12-03 09:51 (10.7.152.26)dhosang pts/2 2013-12-03 10:49 (10.60.145.96) You can also run this to find out who is logged in still dhosang@usrn2netweb01:~$ last | fgrep "still logged in" | cut -d" " -f1 | uniq -udhosangpmackrfrick But let's say you just want to see who has recently logged in and may have already logged out. Well then, run this command dhosang@usrn2netweb01:~$ lastalawrenc pts/4 10.60.130.51 Tue Dec 3 10:57 still logged indhosang pts/2 10.60.145.96 Tue Dec 3 10:49 still logged inpmack pts/1 10.7.152.26 Tue Dec 3 09:51 still logged inrfrick pts/0 10.6.5.224 Tue Dec 3 09:22 still logged inpmack pts/2 10.7.128.40 Mon Dec 2 14:41 - 15:29 (00:47)psheguns pts/1 10.6.16.22 Mon Dec 2 14:37 - 14:44 (00:06)psheguns pts/1 10.6.16.22 Mon Dec 2 14:32 - 14:36 (00:04)psheguns pts/0 10.6.16.22 Mon Dec 2 14:10 - 16:30 (02:19)bjarrett pts/0 10.6.5.151 Mon Dec 2 08:41 - 08:43 (00:01)
Create an account or sign in to comment