Linux/Bash History

From Omnia
Jump to navigation Jump to search

Bash History

  • Ctrl + R = Incremental search of command history
  • Press Ctrl + R again to cycle through history

No logging commands to bash history:

-------- Original Message --------
Subject: 	Re: [sllug-members]: Non-root users and BASH shell history
Date: 		Mon, 20 Apr 2009 10:51:08 -0600
From: 		Erik Falor <>
To: 		Salt Lake Linux Users Group Discussions <>

Add the value 'ignorespace' to your $HISTCONTROL variable.  It causes
bash to not log commandlines which begin with a space.  Then, it's
just a matter of getting into the habit of hitting the spacebar before
entering sensitive commands.

-- Erik Falor

Do not store history


The most likely cause for history items not to show up is not by setting HISTFILE to nothing or HISTSIZE to zero, it is by logging into the same machine twice and exiting with the second bash instance (in which you did little or nothing) after the one where you did a lot. By default Bash doesn't merge histories and the second Bash-exit overwrites the .bash_history that was so nicely update by the first Bash-exit.