When you are using Linux command line frequently, using the history effectively can be a major productivity boost. In fact, once you have mastered the 15 examples that Iâ€™ve provided here, youâ€™ll find using command line more enjoyable and fun.
10. Force history not to remember a particular command using HISTCONTROL
When you execute a command, you can instruct history to ignore the command by setting HISTCONTROL to ignorespace AND typing a space in front of the command as shown below. I can see lot of junior sysadmins getting excited about this, as they can hide a command from the history. It is good to understand how ignorespace works. But, as a best practice, donâ€™t hide purposefully anything from history.
# export HISTCONTROL=ignorespace
# ls -ltr
# service httpd stop [Note that there is a space at the beginning of service, to ignore this command from history]
# history | tail -3
67 ls -ltr
69 history | tail -3
Related Posts: On this day...
- Trollface restaurant - 2011
- W7 Theme for Ubuntu brings Windows 7's familiar GUI to Linux - 2010
- A wonderful Where's Waldo-ish biodiversity book for little ones - 2010
- Flickr v. Free Speech... Where is their courage? - 2009
- 365Black: McDonald's has a website for black people - 2009
- Red Hat hack prompts critical OpenSSH update - 2008