Linux history – the record of commands that you’ve used on the command line – can simplify repeating commands and provide some very useful information when you’re trying to track down how recent system or account changes might have come about. Two things you need to understand before you begin your sleuthing, however, are that the shell’s command memory can be selective and that dates and times for when commands were run are optional.
Basic Linux history
Let’s first look at how dates and times are recorded when commands are entered on the command line. By default, they are not. The history command simply provides a list of previously used commands. That’s all that is saved in the history file. For bash users, this information all gets stuffed into the .bash_history file; for other shells, it might be just .history.