Wednesday, July 24, 2013

Don’t save commands in bash history (only for current session) disable history for current shell session

1-
root# unset HISTFILE
disable history for current shell session
this will cause any commands that you have executed in the current shell session to not be written in your bash_history file upon logout
2-
root# HISTFILE=/dev/null
disable history for current shell session
3-
root# history -c
Clear current session history (bash)
4-
root# export HISTSIZE=0
Don’t save commands in bash history (only for current session)
5-

root# rm ~/.bash_history && kill -9 $$
Sneaky logout
Best way I know to get rid of .bash_history and don’t allow bash to save the current one on exit
Edit: added ~/ before .bash_history, just in case…

No comments:

Post a Comment