...

/

Controlling the History and Setting the Shell Editor

Controlling the History and Setting the Shell Editor

Learn how to control what commands are stored in the history.

Controlling the history

We can control which commands get stored in the history and how many entries are preserved in the current session and across all sessions, all through a handful of shell variables. Let’s add some to our .bashrc file.

The HISTCONTROL variable lets us ignore commands that start with a space. This can be really useful to hide commands containing sensitive information from our history. It’s often a default setting.

The HISTCONTROL ...