Involves fast cursor movement under the Linux command line, command editing, post-editing execution history commands, Bang (!) commands, control commands, and so on. Make basher more efficient.
- CTRL + around key: jump between words
- CTRL + A: Jump to the beginning of our line
- Ctrl+e: Jump to the end of the page
- Ctrl+u: Delete the text before the current cursor (as well as the cut function)
- Ctrl+k: Delete the text that follows the current cursor (and also the cut function)
- Ctrl+l: Perform clear screen operation
- Ctrl+y: Paste Ctrl+u or ctrl+k-cut content
- Ctrl+w: Delete the character of the word before the cursor
- Alt–d: Starts at the cursor position and deletes the word to the right. Delete at the end of the line
Description
- Ctrl–k: Hold down the Ctrl key first, then press the K key;
- Alt–k: Hold down the ALT key first, then press the K key;
- M–k: Click the ESC key First, and then press the K key.
Move cursor
- Ctrl–a: Move to the beginning of the line
- Ctrl–e: Move to end of line
- Ctrl–b: Move backward (left) one character
- Ctrl–f: Move a character backward (right)
- Alt–b: Move back (left) one word
- Alt–f: Move a word backward (right)
- CTRL–XX: Moves between the end of the command line and the cursor
- M-b: Move back (left) one word
- M-f: Move a word backward (right)
Edit command
- Ctrl–h: Delete the character at the left of the cursor
- Ctrl–d: Delete the character at the right position of the cursor (note: The current command line does not have any characters when the system or end terminal is logged off)
- Ctrl–w: Starts with the cursor position and deletes the word to the left. Delete at the beginning of line
- Alt–d: Starts at the cursor position and deletes the word to the right. Delete at the end of the line
- M–d: Starts at the cursor position, deleting the word until the word ends.
- Ctrl–k: Removes all characters from the right until the end of the line, starting at the cursor position.
- Ctrl–u: Starts with the cursor position, removing all characters from the left until the line starts.
- Ctrl–y: Pastes the previously deleted content into the cursor.
- Ctrl–t: The position of the swap cursor and the previous two characters.
- Alt +. : Use the last parameter of the previous command.
- Ctrl–_: The status before the reply. Undo operation.
Ctrl -a + Ctrl -k
or Ctrl -e + Ctrl -u
or Ctrl -k + Ctrl -u
combine to delete an entire row.
Bang (!) Command
- !! : Executes the previous command.
- ^foo^bar: replace Foo in the previous command with bar and execute.
- !wget: Executes the most recent command that starts with wget.
- !wget:p: Only the most recent command starting with wget is printed, not executed.
- !$: The last parameter of the previous command, same as
Alt - .
and $_
.
- !*: All parameters of the previous command
- !*:p: Print the previous command is all parameters, that is,
!*
the content.
- ^ABC: Deletes ABC from the previous command.
- ^foo^bar: replace Foo in the previous command with bar
- ^foo^bar^: replace Foo in the previous command with bar
- !-n: Executes the first n command, executes the previous command:
!-1
, the first 5 commands are executed in the following format:!-5
Find History command
- Ctrl–p: Displays the previous history command for the current command
- Ctrl–n: Displays the next history command for the current command
- Ctrl–r: Search History Command, as the input displays a match command in the history command, enter executes the match command, and the ESC key is displayed at the command line without executing the matching command.
- Ctrl–g: Exit from historical search mode (CTRL–R).
Control commands
- Ctrl–l: Clear the screen, and then, at the top, re-display the contents of the line where the cursor is currently located.
- Ctrl–o: Executes the current command and selects the previous command.
- Ctrl–s: Block Screen output
- Ctrl–q: Allow screen output
- Ctrl–c: Abort command
- Ctrl–z: Suspend command
Repeat Action action
- M – Operation Action: Specifies the number of operations and repeats the specified operation.
Ps:http://www.cnblogs.com/aslongas/p/5899586.html
Linux command line shortcut keys