Bash features-command history command line editing, bash command line
Bash:
GUI: Gnome, KDE, XFCE
CLI: sh, csh, bash, ksh, tcsh, zsh
Shell, sub-shell
Tree: view directory tree
Pstree: view the process directory tree
Bash:
1. Command history and command completion
2. Pipelines and redirection
3. Command alias
4. Edit the command line
5. Expand the command line
6. File Name Configuration
7. Variables
8. Programming
Edit command line:
Cursor jump:
Ctrl + a: Jump to the beginning of the command line
Ctrl + e: jump to the end of the command line
Ctrl + u: Delete the content from the cursor to the beginning of the command line
Ctrl + k: Delete the content from the cursor to the end of the command line
Ctrl + l: clear screen
Command history: history
Save command history to memory buffer
View command history: history
-C: cleared: clears the command history.
-D OFFSET: Command to delete a specified position
-W: write: Save the command history to the historical file.
Environment Variable
PATH: command search PATH
HISTSIZE: the size of the command history buffer.
Usage tips for command history:
! N: The Nth command in the execution history.
! -N: The last n commands in the command history.
!! : Execute the previous command
! Str: the most recent command in the execution history that starts with a specified string.
! $: Reference the last parameter of the previous command
Command completion: PATH environment variable, search under command search PATH
Path completion: