Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In UNIX, how to find users who have logged in yesterday or earlier

Tags:

linux

unix

can anyone please tell me how can I make a list of users who have logged in yesterday or earlier but have not logged out yet. without repeating the same user in the list.

like image 806
Learner_51 Avatar asked Nov 10 '10 08:11

Learner_51


People also ask

How do you check login history in Unix?

In order to find last login times for all users on your Linux machine, you can use the “lastlog” command with no options. By default, you will be presented with the list of all users with their last login attempts. Alternatively, you can use the “-u” option for “user” and specify the user you are looking for.

How do you see list of users who have logged in using Unix?

Linux Command To List Current Logged In Users. w command – Shows information about the users currently on the machine, and their processes. who command – Display information about users who are currently logged in.


1 Answers

last | fgrep "still logged in" | cut -d" " -f1 | uniq -u
like image 55
AndreKR Avatar answered Nov 10 '22 01:11

AndreKR