OS version : Fedora 33
history
command, by default, doesn’t show the date of execution.
From googling, I figured that if you set the global env variable HISTTIMEFORMAT
, one can view the execution dates as well.
But, when I set it, I see the execution date of almost commands wrongly displayed as today.
Below is a snipped output of history
command after setting HISTTIMEFORMAT
variable.
All commands till line 998 are not executed today (05-April-2021), but it is wrongly displayed with today’s date.
Any idea what I am doing wrong ?
988 05 Apr 2021 chmod -vv 700 gg.zip
989 05 Apr 2021 ls -l
990 05 Apr 2021 pwd
991 05 Apr 2021 ls -al
992 05 Apr 2021 clear
993 05 Apr 2021 cd /tmp
994 05 Apr 2021 man dnf > dnfmanPage.txt
995 05 Apr 2021 less dnfmanPage.txt
996 05 Apr 2021 vi dnfmanPage.txt
997 05 Apr 2021 sudo dnf upgrade
998 05 Apr 2021 cal
999 05 Apr 2021 history
1000 05 Apr 2021 export HISTTIMEFORMAT='%d %b %Y ’
1001 05 Apr 2021 history
$