Linux – History of commands


Is there any way to find which commands have been executed between 2 specific dates (like 2 to 3 months period)?

I can use the history command, but I have powered the system on/off.

Is this possible? And how?

Best Answer

  • Not by default. You should install the psacct (Process Accounting) utilities to get this functionality.

    sudo apt-get install acct

    The ubuntu package turns on process accounting as part of the install. It provides the following commands:

    • ac - print statistics about users’ connect time
    • lastcomm - print out information about previously executed commands.
    • sa - summarizes accounting information
    • accton - turns process accounting on or off