Commonly used shortcut keys in the Linux command line

  
 

Command line editing shortcuts (Linux)

history Display command history list

↑(Ctrl+p) Display previous command

↓(Ctrl+ n) Display the next command

!num Execute the num command of the command history list

!! Execute the previous command

!?string? Execute the string containing string The latest command

Ctrl+r Then enter a few characters, start searching up the command containing the character, continue to press Ctrl+r, search for the last matching command

Ctrl+s and Ctrl+ r is similar, just forward search

Alt+< history list first item

Alt+> history list last item

Ctrl+f cursor moves forward A character, quite with ->

Ctrl+b The cursor moves backward by one character, quite equivalent to <-

Alt+f The cursor moves forward by a word

Alt+b cursor moves back a word

ls !$ Execute the command ls, and the parameters of the above command are its parameters

Ctrl+a Move to the beginning of the current line

Ctrl+e Move to the end of the current line

Esc+b Move to the beginning of the current word

Esc+f Move to the end of the current word

Ctrl+l Clear screen

Ctrl+u Cut all characters before the cursor where the command line is located (excluding itself)

Ctrl+k Cut all characters after the cursor (including itself) on the command line

Ctrl+d Delete the character where the cursor is located

Ctrl+h Delete the previous character where the cursor is located

Ctrl+y Paste the character just deleted

Ctrl +w Cut a word before the cursor (with spaces, punctuation, etc.)

Alt+d Cut the word after the cursor

Esc+w Delete the cursor before it The character to the end of its word (separated by a space, punctuation, etc.)

Ctrl+t Reverses the position of the character at and before the cursor and moves the cursor to the next character

Alt+t exchanges current and previous word positions

Alt+u converts current words to uppercase

Alt+l converts current words to lowercase

Alt+c The current vocabulary becomes the first character uppercase

Ctrl+v Insert special characters, such as Ctrl+v+Tab to add Tab character keys

Esc+t Reverse the position of the cursor and its adjacent words

Ctrl+c Delete the entire line

Ctrl+(xu) Press Ctrl and then press x and u to undo the operation

Ctrl+s Suspend the current Shell

Ctrl+q re-enable hangs she

Copyright © Windows knowledge All Rights Reserved