Say that you’ve got to pass some password as command line argument to something. It would probably be a bad idea to store it in your ~/.bash_history, but clearing the file isn't desired either. So you need to temporary disable the command history for the current session. You can do it by unsetting the HISTFILE environment variable.
unset HISTFILE
The result is that while the session is active you can access the history as usual, but it won't be saved to the disk. History for other sessions, will behave as usual.
No comments:
Post a Comment