Hack 64. Ignore specific commands from the history using HISTIGNORE
by Ramesh
Sometimes you may not want to clutter your history with basic commands such as pwd and ls. Use HISTIGNORE to specify all the commands that you want to ignore from the history.Please note that adding ls to the HISTIGNORE ignores only ls and not ls -l. So, you have to provide the exact command that you would like to ignore from the history.
- # export HISTIGNORE=”pwd:ls:ls –ltr:”
- # pwd
- # ls
- # ls -ltr
- # service httpd stop
- # history | tail -3
- 79 export HISTIGNORE=”pwd:ls:ls -ltr:”
- 80 service httpd stop
- 81 history
- [Note: History did not display pwd and ls]
当前内容版权归 Ramesh Natarajan 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Ramesh Natarajan .