Thursday 13 February 2014

How to see all the history of commands ever typed in a log file

http://askubuntu.com/questions/23057/i-would-like-to-create-a-log-of-all-commands-typed-in-terminal

$nano ~/.bash_history


type CTRL+R in terminal and give a keyword, then repeat CTRL+R for next search



http://www.cyberciti.biz/faq/clear-the-shell-history-in-ubuntu-linux/

To clear the history,
$history -c
or
$sudo rm ~/.bash_history


To clear history each log out
$echo 'history -c' >> ~/.bash_logout


Never create a history file
$echo 'unset HISTFILE' >> ~/.bashrc 
$echo 'export LESSHISTFILE="-"' >> ~/.bashrc

No comments:

Post a Comment