ArticleDirectory
Original article address:
I would like to share with you some of the shortcut keys that are usually useful in terminal operations,
Edit command
- CTRL + A: Move to the beginning of the command line
- CTRL + E: Move to the end of the command line
- CTRL + F: forward by character (right)
- CTRL + B: Move backward by character (left)
- Alt + F: forward by word (right)
- Alt + B: Move backward by word (left)
- CTRL + XX: move between the beginning of the command line and the cursor
- CTRL + u: delete from the cursor to the beginning of the command line
- CTRL + K: delete from cursor to end of command line
- CTRL + W: delete from cursor to beginning
- Alt + D: delete from cursor to end
- CTRL + D: Delete the character at the cursor
- CTRL + H: Delete the character before the cursor
- CTRL + Y: paste it to the cursor
- Alt + C: Change the uppercase words from the cursor
- Alt + u: changed from cursor to all uppercase words
- Alt + L: changed from cursor to all lowercase words
- CTRL + T: swap between the cursor and the previous character
- Alt + T: exchange the cursor and previous words
- Alt + backspace: With Ctrl + WSameSimilarly, there are some differences between separators [thanks to rezilla for correcting]
Run the command again.
- CTRL + R: History of reverse search commands
- CTRL + G: Exit from the historical search mode
- CTRL + P: Previous command in history
- CTRL + N: The next command in history
- Alt +.: Use the last parameter of the previous command.
Control Command
- CTRL + L: clear screen
- CTRL + O: Execute the current command and select the previous command
- CTRL + S: block screen output
- CTRL + Q: allow screen output
- CTRL + C: terminate command
- CTRL + Z: suspend command
Bang (!) Command
- !! : Execute the previous command
- ! Blah: Execute the latest commands starting with blah, such! Ls
- ! Blah: P: only print the output, not execute
- ! $: The last parameter of the previous command, which is the same as ALT +.
- ! $: P: print the output! $ Content
- ! *: All parameters of the previous command
- ! *: P: print the output! * Content
- ^ Blah: Delete the blah in the previous command.
- ^ Blah ^ FOO: replace blah in the previous command with foo
- ^ Blah ^ Foo ^: replace all the blags in the previous command with Foo.
End