Section: Linux System Administrator's Manual (1)
Updated: Jul 31, 2004
last [R] ['num] [ -n num ] [adFiowx] [ f file ] [ -t' YYYYMMDDHHMMSS ] [name...] [tty...'']
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.
When last catches a SIGINT signal (generated by the interrupt key, usually control-C) or a SIGQUIT signal (generated by the quit key, usually control-\), last will show how far it has searched through the file; in the case of the SIGINT signal last will then terminate.
The pseudo user reboot logs in each time the system is rebooted. Thus last reboot will show a log of all reboots since the log file was created.
The files wtmp and btmp might not be found. The system only logs information in these files if they are present. This is a local configuration issue. If you want the files to be used, they can be created with a simple touch?(1) command (for example, touch /var/log/wtmp).
Miquel van Smoorenburg, firstname.lastname@example.org
Tutoriais de Tecnologia Web