Saturday, July 06, 2013

View and Change bash history


Always wanted to know what you have been doing via bash? Did you know bash keeps a history of that? Here is a quick way to check it and an easy way to change the history limit and remove not relevant command.

history -w ~/history.txt

vi ~/history.txt

sed -e "s|^# .bashrc|# .bashrc\n\nexport HISTFILESIZE=3000|" -i .bashrc


history -r ~/history.txt