This directory of Linux commands is from Linux in a Nutshell, 5th Edition.
Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.
Buy it now, or read it online on Safari Bookshelf.
last [options] [username] [ttynumber]
Display a list of the most recent logins, taken from the file /var/log/wtmp by default. If you specify a tty number or username, the output will display only the logins for that user or terminal.
-n number, -number
Choose how many lines of logins to display. Thus, last -7 or last -n 7 displays seven lines.
Do not show the hostname from which logins originated.
Display the hostname from which logins originated.
Display both IP address and hostname.
Get the list of logins from a file you choose. The default source is /var/log/wtmp.
Display IP address and hostname. Display the IP address in the numbers-and-dots notation.
Read an old-style (libc5 application) wtmp file. Not likely to be useful on newer systems.
Display shutdown messages and runlevel messages.