How to find the date of the wise history of running Linux commands

I want to know that the team is getting acquainted with the date of the wise history of commands running on the linux server

I used the history command, but it gives a long list of commands that I want to know when the command runs on a specific date.

What kind of team is this?

+6
linux bash
source share
1 answer

The history of executed commands is stored in your shell. Try adding something like you ~/.bashrc

 export HISTTIMEFORMAT="%m/%d - %H:%M:%S: " 

It will change the HISTTIMEFORMAT variable, and bash will save the timestamp in its history accordingly. Then your story will look like this.

 487 08/16 - 16:12:01: cd Downloads 488 08/16 - 16:12:04: ls -a 489 08/16 - 16:12:37: cat README | less 490 08/16 - 16:12:58: pkg-config --list-all | grep webkit 491 08/16 - 16:13:04: history 

Available identifiers

 %d - Day %m - Month %y - Year %T - Time %H - Hours %M - Minutes %S - Seconds 
+7
source share

All Articles