You want to display a list of all last logged in users. The file /var/log/wtmp exists. Which command would you use?

You want to display a list of all last logged in users. The file /var/log/wtmp exists. Which command would you use?

(Enter only the command, without path or options)

You want to display a list of all last logged in users. The file /var/log/wtmp exists. Which command would you use?

(Enter only the command, without path or options)

Answer: last

Explanation/Reference:
From the man pages:
last searches back through the file /var/log/wtmp (or the file designated by the -f flag) and displays a list of all users logged in (and out) since that file was created.  Names of users and tty’s can be given, in which case last will show only those entries matching the arguments. Names of ttys can be abbreviated, thus last 0 is the same as last tty0.



Leave a Reply 0

Your email address will not be published. Required fields are marked *