Displays information about the last commands executed.
lastcomm [ Command ] [ Name ] [ Terminal ]
The lastcomm command displays information, in reverse chronological order, about all previously executed commands that are still recorded in the summary files in the /var/adm/pacct directory. You need to run the /usr/sbin/acct/startup command before you can execute the lastcomm command.
The list the lastcomm command displays can be restricted to:
A terminal can be named fully or abbreviated as a tty. For example, you can specify either the tty0 terminal or the 0 terminal.
For each process, the following information is displayed:
lastcomm
lastcomm a.out root ttyd0
/usr/bin/lastcomm | Contains the lastcomm command. |
/var/adm/pacct | The directory that contains the current accounting summary files. |
The acctcms 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 5L Version 5.2 System Management Concepts: Operating System and Devices.
Setting Up an Accounting System in AIX 5L Version 5.2 System Management Guide: Operating System and Devices describes the steps you must take to establish an accounting system.