last Command Purpose Displays information about previous logins. Syntax last [ -f FileName ] [ -Number ] [ Name ... ] [ Terminal ... ] Description The last command displays, in reverse chronological order, all previous logins and logoffs still recorded in the /var/adm/wtmp file. The /var/adm/wtmp file collects login and logout records as these events occur and holds them until the records are pro- cessed by the acctcon1 and acctcon2 commands as part of the daily reporting procedures. The list can be restricted to: * The number of lines specified by the -Number parameter. * Logins or logoffs by the users specified by the Name parameter. * Logins or logoffs from the terminals specified by the Terminal parameter. A terminal can be named fully or abbreviated as a tty. For exam- ple, you can specify either the tty0 terminal or the 0 terminal. If you specify both a Name and Terminal parameter, the last com- mand displays all logins and logoffs meeting either criterion. For each process, the last command displays the: * Time the session began * Duration * Terminal (tty) used If applicable, the following information is included: * Terminations due to rebooting * Sessions that are still continuing If the last command is interrupted, it indicates how far the search has progressed in the /var/adm/wtmp file. If interrupted with a quit signal, the command indicates how far the search has progressed and then continues the search. The quit signal can be any one of the following: #define SIGQUIT 3 /* (*) quit, genertated from terminal special char */ #define SIGKILL 9 /* kill (cannot be caught or ignored) */ #define SIGTERM 15 /* software termination signal */ The kill command sends the default SIGTERM signal when it is in- voked without any option. If you want to send the SIGQUIT sig- nal, enter the following: kill -3 (Process ID) See the kill command for more information. Flags -f FileName Specifies an alternate file from which to read logins and logoffs. Examples 1. To display all the recorded logins and logoffs by user root or from the console terminal, enter: last root console 2. To display the time between reboots of the system, enter: last reboot The reboot pseudo-user logs in when the system starts again. Implementation Specifics This command is part of Accounting Services in the Base Operating System Extensions 2 and is provided for compatibility with Berke- ley Software Distribution (BSD) systems. Files /usr/bin/last Specifies the path to the last command. /var/adm/wtmp Contains connect-time accounting data, including login, logoff, and shutdown records. Related Information The acctcon1 and accton2 command, lastlogin command. For more information about the Accounting System, the preparation of daily and monthly reports, and the accounting files, see the Accounting Overview in AIX Version 3.2 System Management Guide: Operating System and Devices How to Set Up an Accounting System in AIX Version 3.2 System Management Guide: Operating System and Devices describes the steps you must take to establish an accounting system.