Monday, August 26, 2013

Command History:

Any command executed on the machine gets logged. By default on bash the history size is 1000 commands. You can check your current size by

  • $ echo $HISTSIZE
this setting is stored in .bashrc , if you open it up you ll see something like this
  • HISTSIZE=1000 
It a good idea to increase the HISTSIZE to store a large number of commands, which can be rendered for quick execution with reverse-i-search.

There is also an interesting hack/trick around this :) . 
You can override the logging behavior but prefixing every command with a space. Interestingly commands executed in such fashion do not show up in the output of the 'history' command.

Also command history can be disabled by setting

  • HISTFILESIZE=0
in .bashrc

No comments:

Post a Comment