Gautham C.
Gautham C.

Reputation: 1202

Command to tell WHEN you ran the last executed command in bash?

Is there a command or a technique to figure out exactly what time I ran the last command in bash?

Upvotes: 1

Views: 375

Answers (1)

Sebastian
Sebastian

Reputation: 1428

you can use the bash history:

export HISTTIMEFORMAT="%F %T "

this will log the commands you enter on the terminal (not the ones that are run inside a script).

view the result with the command history or inspect ~/.bash_history.

To make this permanent, add the above line to ~/.bashrc.

Upvotes: 3

Related Questions