First, edit the command
Ctrl + A: Move to the beginning of the command
Ctrl + E: Move to the end of the command line
Ctrl + F: Move forward by character (right)
Ctrl + B: Move back (left) by character
Alt + F: Move forward by word (right)
Alt + B: Move back by word (left)
Ctrl + XX: Move between the command line and the cursor
Ctrl + u: Remove from cursor to command line
Ctrl + K: Remove from cursor to end of command line
Ctrl + W: Remove from cursor to Word header
Alt + D: Remove from cursor to end of word
Ctrl + D: Deletes the character at the cursor
Ctrl + H: Delete characters before the cursor
Ctrl + y: Paste to Cursor
Alt + C: Change the word from the cursor to the capital letter
Alt + u: change from cursor to all uppercase words
Alt + L: Change from cursor to all lowercase words
Ctrl + t: Swap the cursor and previous characters
Alt + t: Swap the cursor and previous words
Alt + Backspace: Similar to Ctrl + W, delimiters somewhat different [thank Rezilla correction]
Second, control orders
Ctrl + L: Clear screen
Ctrl + O: Executes the current command and selects the previous command
Ctrl + S: Block screen output
Ctrl + Q: Allow screen output
Ctrl + C: Terminate command
Ctrl + z: Suspend command
Iii. re-executing the order
Ctrl + r: Reverse Search Command History
Ctrl + G: Exit from historical search mode
Ctrl + P: previous command in history
Ctrl + N: The next command in history
Alt +.: Use the last argument of the previous command
Four, Bang (!) command
!! : Execute Previous command
!blah: Executes the most recent command that begins with blah, such as!ls
!blah:p: Print output only, not execute
!$: Last parameter of previous command, with Alt +. Same
!$:p: Contents of!$ printout
!*: All parameters of previous command
!*:p: Contents of!* printout
^blah: Deletes the blah from the previous command
^blah^foo: Replace the blah in the previous command with Foo
^blah^foo^: Replaces all blah in the previous command with Foo
Summarize:
Most of the bash shortcuts described above are valid only in Emacs editing mode, and if you configure Bash as VI edit mode, it will follow the key binding of VI.
Bash defaults to emacs edit mode. If your Bash is not in Emacs edit mode, you can set it by Set-o Emacs.
^s, ^q, ^c, ^z are processed by terminal equipment and can be set by Stty commands.