Linux command line shortcut keys

Source: Internet
Author: User
Tags clear screen

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.

    • Common
    1. CTRL + around key: jump between words
    2. CTRL + A: Jump to the beginning of our line
    3. Ctrl+e: Jump to the end of the page
    4. Ctrl+u: Delete the text before the current cursor (as well as the cut function)
    5. Ctrl+k: Delete the text that follows the current cursor (and also the cut function)
    6. Ctrl+l: Perform clear screen operation
    7. Ctrl+y: Paste Ctrl+u or ctrl+k-cut content
    8. Ctrl+w: Delete the character of the word before the cursor
    9. 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 -kor 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.