[Reserved] Linux command line shortcuts - to move the cursor

Linux Command-Line Shortcuts - Move the cursor

Involved in the linux command line to quickly move the cursor, command editing, command execution history after editing, Bang (!) Command, control commands. Let basher more efficient.

  •  Common
  1. ctrl + left and right keys: jump between words
  2. ctrl + a: jump to the beginning of the line of the Bank
  3. ctrl + e: Jump footer
  4. Ctrl + u: delete the current cursor in front of the text (as well as cut function)
  5. ctrl + k: delete the current behind the text cursor (also cut function)
  6. Ctrl + L: Clears the screen
  7. Ctrl + y: Ctrl + u paste content or shear ctrl + k
  8. Ctrl + w: delete the word character in front of the cursor
  9. Alt - d: starting from the cursor position, the right to delete words. Delete to end of line

Explanation

  • Ctrl - k: Hold down the Ctrl key, then press the k button;
  • Alt - k: Hold down the Alt key, then press the k button;
  • M - k: first click the Esc key, and then press the k button.

Move the cursor

  • Ctrl - a: to start of line
  • Ctrl - e: Position the cursor on
  • Ctrl - b: back (left) one character
  • Ctrl - f: back (right) one character
  • Alt - b: back (left) to move a word
  • Alt - f: back (Right) move a word
  • Ctrl - xx: move between the command cursor and the end of the line
  • Mb: back (left) to move a word
  • Mf: back (Right) move a word

Edit command

  • Delete the character left of the cursor position: h - Ctrl
  • Ctrl - d: Delete character right of the cursor position (Note: the current command line without any characters, the system will log off or end terminals)
  • Ctrl - w: starting from the cursor position to the left to delete the word. To the beginning of the line deleted
  • Alt - d: starting from the cursor position, the right to delete words. Delete to end of line
  • M - d: starting from the cursor position, delete the word, until the end of the word.
  • Ctrl - k: starting from the cursor position, deletes all characters to the right, until the end of the line.
  • Ctrl - u: starting from the cursor position, deletes all characters to the left until the start of the line.
  • Ctrl - y: Paste the contents to be deleted before the cursor.
  • ctrl - t: two switching positions and the character before the cursor.
  • Alt +:. The final parameter on the use of a command.
  • Ctrl - _: Reply to state before. Undo.

Ctrl -a + Ctrl -k Or  Ctrl -e + Ctrl -u or  Ctrl -k + Ctrl -u combination delete the entire line.

Bang (!) Command

  • !!: a command execution.
  • ^ Foo ^ bar: the last command in the Replace foo bar, and executed.
  • ! Wget: executes the most recent command that starts with wget.
  • ! Wget: p: print only the most recent command beginning with wget is not executed.
  • ! $: The last argument of the previous command, and  Alt - . and  $_ the same.
  • ! *: All parameters on a command
  • ! *: p: print command is all on one parameter, namely  !*content.
  • ^ Abc: delete a command abc.
  • ^ Foo ^ bar: The last command is replaced with foo bar
  • ^ Foo ^ bar ^: The last command is replaced with foo bar
  • ! -n: n Article executed before the command is executed on a command:  !-1format before executing the command 5 is: !-5

Find command history

  • Ctrl - p: a display on the history of the current command command
  • Ctrl - n: the next history command displays the current command
  • Ctrl - r: search command history, command history will be displayed along with the input of a matching command, Enter key to perform the matching command; ESC key to display the command line without executing the command match.
  • Ctrl - g: the history search mode - Exit (Ctrl r).

control commands

  • Ctrl - l: clear the screen, then again displays the contents of the line where the cursor is currently at the top.
  • Ctrl - o: execution of the current command, and select the command.
  • Ctrl - s: stop screen output
  • Ctrl - q: allows screen output
  • Ctrl - c: termination command
  • Ctrl - z: Suspend command

Operation is repeatedly performed operations

  • M - operation count operation action: Specifies the number of operations is repeatedly performed a specified operation.

Reproduced in: https: //www.cnblogs.com/licheng/p/6824171.html

Guess you like

Origin blog.csdn.net/weixin_33762321/article/details/92629418