linux control history command history

1, custom history function can be achieved through the environment variable

1.1, HISTSIZE: history number command bar can be retained, if this variable is set to 0, no history records
save location history historical documents, the default .bash_history files, empty or delete this file, you can clear the history command: 1.2, HISFILE
1.3, HISTFILESIZE: the number of saved history command bar .bash_history file
1.4, HISTTIMEFORMAT: history display time

 export HISTTIMEFORMAT='%F %T '

1.5, HISTCONTROL: History Control commands

= HISTCONTROL ignoredups # ignore continuously repeated command 
HISTCONTROL = ignorespace # ignore commands begin with a space 
HISTCONTROL = ignoreboth # ignore these two 
HISTCONTROL = erasedups # ignore all commands history repeats

Example:

export HISTCONTROL=ignorespace

Guess you like

Origin www.cnblogs.com/likoo/p/11714079.html
Recommended