Command history
Summary: Bash holds a list of commands that have been executed in the past.
The command process for the current shell is saved in memory.
When you exit, save the hidden folder to the current User folder. Bash_histroy, ls-a can view
History Shortcuts:
!#: #为命令历史列表中的命令编号 (#history: View the history and number of commands in the cache)
!: Executes the previous one, equivalent to the direction key
!-1: Perform the first countdown command
!string: The last command in the execution history that starts with string
History-c: Emptying the command history in the cache
history-d #: Delete section # command
HISTORY-A: Append to Buffer
arguments referencing the previous command :
!$ or shortcut ESC release and press.
Environment Variables for command history
Histsize:
echo $HISTSIZE: View the value of a variable-"1000
Histfile:
echo $HISTFILE:/root/.bash_history
Histfilesize:
echo $HISTFILESIZE: 1000
Histcontrol: Controlling the generation of command history
Echo $HISTCONTROL
1. Ignoredups: Ignore consecutive and repetitive commands
2. Ignorespace: The command to start the space is ignored
3. Ignoreboth: Merging on two functions
To modify the value of the Histcontrol, just run the assignment statement.
3. Self-learning Linux road: Shell feature three: command history