Linux / Unix: lastcomm Command Examples

The “lastcomm” command in Linux/Unix displays information about previously executed commands on the system. It shows the name of the command, the time it was executed, the username, and other information.

For example, to display a list of all previously executed commands, use the following command:

$ lastcomm

To display information about a specific command, use the following syntax:

$ lastcomm command-name

Replace “command-name” with the actual name of the command you want to see information about.

You can also filter the output by specifying options such as “-u username” to display information only for a specific user, or “-t time” to display information only for a specific time period. For a complete list of options, use the following command:

$ man lastcomm

Leave a Comment