O'Reilly logo

Linux in a Nutshell, 6th Edition by Robert Love, Stephen Figgins, Ellen Siever, Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

last

Synopsis

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 displays only the logins for that user or terminal.

Options

-a

Display the hostname from which logins originated in the last column.

-d

For remote logins, display both IP address and hostname.

-f filename

Get the list of logins from filename. The default source is /var/log/wtmp.

-i

Like -d, but display the IP address in numbers-and-dots notation.

-n number, -number

Choose how many lines of logins to display. Thus, last −7 or last -n 7 displays seven lines.

-R

Do not show the hostname.

-x

Display shutdown messages and runlevel messages.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required