Linux Easy Way to Use Previous Commands
Linux Easy Way to Use Previous Commands
January 31, 2023
Different ways to save terminal outputs in linux
Different ways to save terminal outputs in Linux
February 14, 2023

February 7, 2023

Execution of a command in bash without saving it

The shell variable HISTCONTROL controls what goes into the command history of bash shell. If HISTCONTROL variable equals to "ignorespace", that means commands starting with a space are not saved in history.

$ HISTCONTROL ignorespace
$ echo $HISTCONTROL
ignorespace
$ date
Fri Oct 21 14:20:36 +03 2022
$ uname
Linux
$ history
2007 HISTCONTROL="ignorespace"
2008 echo $HISTCONTROL
2009 date
2010 history
#Because of the space before uname command, it does not appear in
command history.
Execution of a command in bash without saving it
This website uses cookies to improve your experience. By using this website you agree to our Data Privacy Statement
Read more