//View Tip #814
Similar Tips
» Truncated $PWD in the command prompt
» .. revisited
» Generate a random password
» Zero files
» Bash efficiency formula ;-)

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
If you're working in bash and want to quit without saving your history, you can do so using:

kill -9 $$

$$ gives the pid of the current bash instance, and the kill ends the process. There are other ways of disabling history in bash, but this can be used with no forward planning and any time/place you like.


View Comments »




Comments 

Add your comment

Comments are currently disabled
could also use the following:

# unset SAVEFILE;unset HISTFILE;
Posted 2009-05-15 10:07:36
Never thought of this one! :-) Nice Trick!
Posted 2009-05-15 11:34:21
Why not to add clean command to .bash_logout?

Something like:
echo rm .bash_history >> .bash_logout
Posted 2010-01-12 06:43:04

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit