Forrest logo
back to the lastcomm tool

lastcomm:tldr:9f0dc

lastcomm: Print information about all the commands in the acct (record file).
$ lastcomm
try on your machine

The "lastcomm" command in Unix-like operating systems is used to display information about previously executed commands on the system. It retrieves details from the "acct" file, which is maintained by the system's accounting services.

When you run the "lastcomm" command, it prints a list of all the commands that have been executed on the system since the accounting files were last flushed. The output typically includes details about the command's execution time, user, CPU time, execution status, and other relevant information.

The "lastcomm" command allows system administrators and users to review and analyze the commands that have been run on the system. It can help in identifying potential security breaches, monitoring resource usage, tracking down problems, and understanding system behavior.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lastcomm tool