Skip to content

Instantly share code, notes, and snippets.

@hemanth22
Created March 10, 2019 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hemanth22/c164931226e31e7ce24d06f35d7e33ec to your computer and use it in GitHub Desktop.
Save hemanth22/c164931226e31e7ce24d06f35d7e33ec to your computer and use it in GitHub Desktop.
How to configure history in centos

First execute below command.

[bhemanth@localhost ~]$ set | grep HIST

Commnd Output.

HISTCONTROL=ignoredups
HISTFILE=/home/bhemanth/.bash_history
HISTFILESIZE=1000
HISTSIZE=1000
    local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//');

After getting above output add below configuration in .bashrc file in centos.

export HISTCONTROL=ignoredups
export HISTFILE=/home/bhemanth/.bash_history
export HISTTIMEFORMAT='%b %d %I:%M %P '
export HISTFILESIZE=100000
export HISTSIZE=100000
export HISTIGNORE="history:history -c:history -d:clear:exit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment