Displays information about the last commands executed.
lastcomm [ -X ][ Command ] [ Name ] [ Terminal ]
The lastcomm command displays information, in reverse chronological order, about all previously executed commands that are still recorded in the /var/adm/pacct summary file. 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:
| Item | Description | 
|---|---|
| S | The root user executed the command. | 
| F | The command ran after a fork, but without a following subroutine. | 
| C | The command ran in PDP-11 compatibility mode. | 
| D | The command terminated with the generation of a core file. | 
| X | The command was terminated with a signal. | 
| Item | Description | 
|---|---|
| -X | Prints all available characters of each user name instead of truncating to the first 8 characters. | 
lastcommlastcomm a.out root ttyd0lastcomm -X| Item | Description | 
|---|---|
| /usr/bin/lastcomm | Contains the lastcomm command. | 
| /var/adm/pacct | The directory that contains the current accounting summary files. |