The history command shows us in the terminal the commands that we have executed in the past, something like this:
So far so good, but what if we want to know exactly when we executed each command in the past? O_O
I mean, see something like this:
To do this, we must put this command in the terminal:
export HISTTIMEFORMAT='%F %T : '
Then they run again history and see the result 🙂
Now, what we just did will not be permanent, that is, when we close the session (or turn off the computer) this cool way of seeing the output of the history command will be forgotten by the system, to make it permanent we must run the following:
echo "export HISTTIMEFORMAT='%F %T : '" >> $HOME/.bashrc
That is, put that command at the end of our file .bashrc that is hidden in our home.
By the way, for those who wonder what does% F and% T mean…% F means the date in year-month-day mode, while% T is the time in hour-minute-second mode (24-hour time ).
Well I don't think there is anything else to say, it is a fairly short post but I think the tip is interesting ^ - ^