Need to add date to bash history, knowing when some commands were fired.
Before the change:
root@host# history
1 ifconfig
2 ifup eth0
3 ifconfig
4 shutdown -r now
root@host# history
1 ifconfig
2 ifup eth0
3 ifconfig
4 shutdown -r now
Now, make appripriate changes in your bash profile:
echo ‘export HISTTIMEFORMAT=”%d/%m/%y %T “‘ >> ~/.bash_profile
echo ‘export HISTTIMEFORMAT=”%d/%m/%y %T “‘ >> ~/.bash_profile
Open another SSH session and check
Shell
1 Dec/28 – 12:22:13 ifconfig
2 Dec/28 – 12:23:37 ifup eth0
3 Dec/28 – 12:24:51 ifconfig
4 Dec/28 – 12:25:45 shutdown -r now
Recent Comments