Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Apr 232010

How to avoid command being saved to shell history


Firstly, you need to set the Bash shell environment variable to tell the shell to ignore the history if the command is starting with a particular character, e.g. a space in our case below.

# export HISTIGNORE="&:[ ]*"

Then, type the command start with a space

# who

And verify using the history command

# history

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>