[CENTOS] Linux command line shortcut
Move cursor
| command |
Operation explanation |
| Ctrl + b |
Move one character backward |
| Ctrl + f |
Move one character forward |
| Ctrl + a |
Move to the beginning of the line |
| Ctrl + e |
Move to the end of line |
| Alt + b |
Move one word backward |
| Alt + f |
Move one word forward |
Delete and insert
- In bash, paste is called yank.
| command |
Operation explanation |
| Ctrl + h |
Delete one character behind |
| Ctrl + d |
Delete one character at the cursor position |
| Ctrl + w |
Delete one word at the end separated by a space |
| Ctrl + k |
Delete (cut) from the cursor position to the end of the line |
| Ctrl + u |
Delete (cut) from the cursor position to the beginning of the line |
| Ctrl + y |
Insert the last deleted content (Yank) |
Screen operation
- Note that the character string typed in while locked with Ctrl + s is accepted.
| command |
Operation explanation |
| Ctrl + s |
Lock screen display |
| Ctrl + q |
Unlock screen display |
| Ctrl + c |
Forcibly terminate the command being executed |
| Ctrl + l |
Delete the history displayed on the screen |
Command history search
| command |
Operation explanation |
| Ctrl + p |
Move to the previous command history |
| Ctrl + n |
Move to the next command history |
| Ctrl + r |
Start incremental search |
Incremental search (Ctrl + r)
| command |
Operation explanation |
| Character input |
Add a search term and search again |
| Ctrl + r |
Move to the previous search result |
| Enter |
Run current search results as is |
| Esc |
Return to command line with current search results displayed |
| Ctrl + g |
Discard the search results and return to the prompt |
| Enter |
Run current search results as is |
Incremental search Example of searching with "ec"
(reverse-i-search)`ec': echo hello world
References: New Linux textbook (written by Hideaki Miyake and Yusuke Ohsumi)