If you want to add this settings to globally use /etc/bash.bashrc
First you need to Edit your $HOME/.bashrc file
#vi $HOME/.bashrc
Add the following line
export HISTTIMEFORMAT="%h/%d -- %H:%M:%S "
Save and exit the file.
From next login instead of:
574 tail -f /var/log/maillog
575 mailq | tail -15
576 tail -f /var/log/maillog
577 less /var/log/maillog
you get:
1002 May/09 -- 11:46:16 grep log /var/log/maillog
1003 Apr/09 -- 14:17:40 passwd test
1004 Apr/09 -- 14:50:28 history 15
Some more bash history tips
The most efficent way to search your history is to hit Ctrl R and type the start of the command. It will autocomplete as soon as there’s a match to a history entry, then you just hit enter
If you don't want to save duplicate commands use the following option in your bashrc file ($HOME/.bashrc)
HISTCONTROL=ignoreboth
If you want to set the size of the history file use the following option in your bashrc file ($HOME/.bashrc)
HISTSIZE=500
Incoming search terms:
-
http://www.debian.sh Robert Tulke
-
http://www.debian.sh Robert Tulke
-
http://hardikmehta.wordpress.com rangalo
-
http://berger-kostya.livejournal.com Kostya Berger
-
nima0102
