Common shortcut keys for Ubuntu Terminals
Many operations in Ubuntu are very convenient in the Terminal, and remember some shortcut key operations more handy. In Ubuntu, press Ctrl + Alt + T to open the terminal. Other commonly used shortcut keys are as follows:
Shortcut Key |
Function |
Tab |
Auto-completion |
Ctrl + |
Move cursor to start position |
Ctrl + e |
Move cursor to the end |
Ctrl + k |
Delete all content from here to the end |
Ctrl + u |
Delete all content from here to start |
Ctrl + d |
Delete current character |
Ctrl + h |
Delete the first character before the current character |
Ctrl + w |
Delete words from here to left |
Ctrl + y |
PasteCtrl + u,Ctrl + d,Ctrl + wDeleted word |
Ctrl + l |
It is equivalent to clear, that is, clear screen |
Ctrl + r |
Search for History commands |
Ctrl + B |
Move the cursor back |
Ctrl + f |
Move cursor forward |
Ctrl + t |
Exchanges The character at the cursor position with the first character. |
Ctrl + & |
RestoreCtrl + hOrCtrl + dOrCtrl + wDeleted content |
Ctrl + S |
Pause screen output |
Ctrl + Q |
Continue screen output |
Ctrl + Left-Arrow |
Move cursor to the first word of the previous word |
Ctrl + Right-Arrow |
Move cursor to the end of the next word |
Ctrl + p |
Show cache commands up |
Ctrl + n |
Show down cache commands |
Ctrl + d |
Close the terminal |
Ctrl + xx |
Move at EOL and current cursor position |
Ctrl + x @ |
Show possible completion of hostname |
Ctrl + c |
Terminate process/command |
Shift+ Top or bottom |
Terminal scroll up/down |
Shift + PgUp/PgDn |
Terminal page flip |
Ctrl + Shift + n |
New Terminal |
Alt + F2 |
Enter gnome-terminal to open the terminal |
Shift + Ctrl + T |
Open a new tab |
Shift + Ctrl + W |
Close Tab |
Shift + Ctrl + C |
Copy |
Shift + Ctrl + V |
Paste |
Alt + number |
Switch to the corresponding Tab |
Shift + Ctrl + N |
Open a new terminal window |
Shift + Ctrl + Q |
Wall terminal window |
Shift + Ctrl + PgUp/PgDn |
Move left to right |
Ctrl + PgUp/PgDn |
Switch Tab |
F1 |
Open Help Guide |
F10 |
Activation menu bar |
F11 |
Full Screen Switch |
Alt + F |
Open the file menu) |
Alt + E |
Open the "edit" menu (edit) |
Alt + V |
Open the view menu) |
Alt + S |
Open the search menu) |
Alt + T |
Open the terminal menu (terminal) |
Alt + H |
Open the "help" menu (help) |
Other Tips: press the Tab key twice in a command prompt in the terminal window, press the Esc key three times in a row, or press Ctrl + I, the names of all commands and tools are displayed. The Application key is the key on the left of the right Ctrl key on the keyboard. It is equivalent to right-clicking.
===== Terminal ====
CTRL + ALT + T: Open the terminal
TAB: Automatic completion command or file name
CTRL + SHIFT + V: paste (if you do not need to copy the text in Linux, the text will be automatically copied when selected)
CTRL + SHIFT + T: Create a tab
CTRL + D: Close the tab
CTRL + L: clear screen
CTRL + R + Text: Search in input history
CTRL + A: Move to the beginning of the line
CTRL + E: Move to the end of the row
CTRL + C: Terminate the current task
CTRL + Z: Put the current task in the background for running (equivalent to adding & when running the command &)
~ : Indicates the user directory path.
===== If you open a program ======
Take "System Configuration" as an example. Press "SUPER + A", "SUPER", or "Win", switch to the Chinese Input Method, enter "System Configuration", and press enter to open the program. Then press the TAB key to browse the sub-configuration program in the System Configuration.
===== Desktop ====
ALT + F1: focus on the task navigation bar on the left side of the desktop. you can press the up or down key to navigate.
ALT + F2: run the command
ALT + F4: Close the window
ALT + TAB: Switch program window
ALT + space: Open the window menu
PRINT: Desktop
SUPER: Open the Dash panel and search for or browse projects. By default, there is a search box. Press the "down" arrow key to enter the browsing area (the SUPER key is the Win key or the apple Command key)
Press CTRL + TAB on the Dash panel to switch to the next sub-panel (you can search for different types of projects, such as programs, files, and music)
SUPER + A: Application)
SUPER + F: search for or browse files)
SUPER + M: search for or browse Music files)
===== Orca read screen software ====
Start Orca: SUPER + A, enter orca, and press ENTER
ORCA + space: display the preference dialog box (the ORCA key refers to the Insert key or the caps lock Case conversion key, depending on the setting)
ORCA + t: Current read time
ORCA + tt: read current date
ORCA + s: Switch the speech synthesis Switch
ORCA +/: Read the title
ORCA + //: Read the status bar
ORCA + semicolon: Read the entire file
ORCA + Q: log out of Orca
For more shortcut keys, refer to the Key Binding Tab Of the Orca preference.
===== Firefox ====
Method for entering Firefox:
1. SUPER + A, press firefox, and press Enter. This is to search for applications running on the Dash panel. In fact, you only need to press fir to locate the Firefox program.
2. ALT, press firefox, and press Enter. This is equivalent to running a command in the command line.
3. Press firefox & and enter in the terminal. This method is applicable to users who use the terminal as the main operation window. You can use the TAB key to automatically complete the command (just enter the first few letters and then press the TAB key ). & It means running in the background in shell, so that the terminal will not be monopolized by Firefox.
CTRL + T: Create a tab
CTRL + W: Close the tab
CTRL + SHIFT + T: re-open a recently closed tab
CTRL + TAB: switch to the next TAB
CTRL + SHIFT + TAB: switch to the previous TAB
ALT + [1-8]: Jump to the created Tab
ALT + 9: Jump to the last tab
CTRL + L: Jump to the address bar
ESC: stops loading the current page.
CTRL + K: Jump to the search engine input box
CTRL + F: search on the current page
/: Quick search. In Linux, many programs (such as VI, Man, and Less) Use/as the search shortcut key and can be searched using a regular expression. However, Firefox does not support regular expression search.
CTRL + D: Add bookmarks to favorites
ALT + left arrow key: backward
ALT + v: Forward
CTRL + Q: Exit
===== Gedit text editor ====
Start gedit: SUPER + A, press gedit, and press ENTER
CTRL + N: create a document
CTRL + W: Close the document
CTRL + S: Save
CTRL + SHIFT + S: Save
CTRL + S: Search
CTRL + H: search and replace
CTRL + I: jump to a row
CTRL + C: Copy
CTRL + V: Paste
CTRL + X: Cut
CTRL + Q: Exit
===== Nautilus File Manager ====
How to start Nautilus:
1. SUPER + 1. This method is only applicable when the fast start position of Nautilus on the left is not changed.
2. SUPER + A, enter nautilus, and press ENTER
F2: Rename
CTRL + 1: icon view
CTRL + 2: List View
CTRL + T: Create a tab
CTRL + W: Close the tab
CTRL + D: Add bookmarks to favorites
CTRL + Q: Exit
Nautilus also has many shortcut keys consistent with Firefox.
===== Rhythmbox audio player ====
CTRL + space: Play/pause
ALT + right arrow key: Next
ALT + left arrow key: Previous
CTRL + up arrow key: increase the volume
CTRL + down arrow key: reduce volume
CTRL + U: Random playback
CTRL + R: Replay
CTRL + Q: Exit
========================================================== ==========
VI
Vi/vim basic usage
The vi editor is a standard editor for all Unix and Linux systems. It is not inferior to any of the latest text editors. Here we just briefly introduce its usage and a few instructions. The vi editor is identical for any version of Unix and Linux systems, so you can learn more about it in any other section about vi. Vi is also the most basic text editor in Linux. After learning it, you will be able to enjoy the free access in the Linux World.
1. Basic concepts of vi
Basically, vi can be divided into three states: command mode, Insert mode, and last line mode. The functions of each mode are as follows:
1) command Line mode)
Controls the movement of the screen cursor, the deletion of characters, words, or rows, the movement of copying a segment and entering the Insert mode, or to the last line mode.
2) Insert mode)
You can enter text only in Insert mode. Press ESC to return to command line mode.
3) Baseline mode)
Save the file or exit vi. You can also set the editing environment, such as searching strings and listing row numbers ...... .
However, we generally simplify vi into two modes in use, that is, the last line mode is also included in the command line mode ).
2. Basic operations of vi
A) Go to vi
After the system prompts you to enter the vi and file name, you will be taken to the vi full screen editing screen:
$ Vi myfile
Note that after entering vi, you are in command mode. You must switch to Insert mode to Enter text. People who use vi for the first time will want to move the cursor first with the upper and lower right keys. As a result, the computer keeps beeping and getting angry with themselves. So after entering vi, do not tamper with the mouse, switch to "Insert mode!
B) switch to Insert mode to edit the file
Click "I" under "command mode" to enter "Insert mode". Then, you can enter the text.
C) Insert switchover
You are currently in "Insert mode", and you can only enter text all the time. If you find that you have entered an error! To move the word back with the light mark key, you must first Press ESC to switch to command mode and then delete the text.
D) Exit vi and save the file
Under "command mode", click ":" colon to enter "Last line mode". For example:
: W filename (enter "w filename" to save the article with the specified filename)
: Wq (enter "wq" to save the disk and exit vi)
: Q! (Enter q !, Force exit vi without saving the disk)
3. command mode function key
1). insert mode
Press "I" to switch to the insert mode "insert mode". Press "I" to enter the insert mode. The input file starts from the current position of the cursor;
After you press "a" to enter the insert mode, the text is entered starting from the next position where the cursor is currently located;
After you press "o" to enter the insert mode, a new row is inserted and text is entered from the beginning of the line.
2) switch from insert mode to Command Line Mode
Press ESC.
3) move the cursor
Vi can be moved up, down, left, and right directly with the cursor on the keyboard, but the regular vi uses lowercase letters "h", "j", "k", and "l 」, the cursor is controlled to move one cell to the left, down, up, and right respectively.
Press ctrl + B to move the screen to the back.
Press ctrl + f to move the screen to the front.
Press ctrl + u to move the screen to the back half of the page.
Press ctrl + d to move the screen half to the front.
Press the number "0": to move to the beginning of the article.
Press G to move to the end of the article.
Press "$" to move to the end of the row where the cursor is located ".
Press ^ to move the cursor to the beginning of the row"
Press w to jump to the beginning of the next word
Press "e": move the cursor to the end of the next word
Press "B": the cursor returns to the beginning of the previous word
Press # l to move the cursor to the # position of the row, such as 5l and 56l.
4). delete text
"X": each time you press the button, the "Next" character of the cursor is deleted.
"# X": for example, "6x" indicates deleting the "Next" 6 Characters of the cursor position.
"X": uppercase X. Each time you press it, the "front" character of the cursor is deleted.
"# X": for example, "20X" indicates the position where the cursor is located, which is a string of 20 characters.
Dd: Delete the row where the cursor is located.
「 # Dd 」: delete from the row where the cursor is located # Row
5). Copy
"Yw": copy the character at the end of the cursor to the buffer zone.
# Yw: Copy # words to the buffer zone
"Yy": copy the row where the cursor is located to the buffer zone.
"# Yy": for example, "6yy" indicates copying 6 lines of text from the row where the cursor is located "down.
P: place the characters in the buffer to the cursor position. Note: All copy commands related to "y" must work with "p" to complete the copy and paste function.
6). Replace
"R": Replace the character at the cursor position.
"R": Replace the character wherever the cursor goes until you press the "ESC" key.
7). Restore/Undo/restore the last operation
"U": If a command is mistakenly executed, immediately press "u" to cancel the previous operation. You can perform multiple Undo operations by pressing "u" multiple times.
8). Change
"Cw": change the word at the cursor to the ending point.
"C # w": for example, "c3w" indicates that three words are changed.
9). Jump to the specified row
Ctrl + g lists the row numbers of the cursor.
"# G": for example, "15G" indicates moving the cursor to the first row of the article.
4. Introduction to commands in Last line mode
Before using "last line mode", remember to press the "ESC" key to confirm that you are already in "command mode" and then press 「: "colon to enter" last line mode 」.
A) List row numbers
"Set nu": After "set nu" is entered, the row number is listed before each row in the file.
B) jump to a row in the file.
"#": "#" Indicates a number. Enter a number after the colon and press enter to jump to the row. For example, enter the number 15 and press Enter, this will jump to the second line of the article.
C) Search for characters
"/Keyword": First press the "/" key and then enter the character you want to search. If the first search keyword is not what you want, you can always press "n" until you find the keyword you want.
「? Keyword: First press 「?」 Enter the character you want to search for. If the keyword you want for the first time is not what you want, you can press "n" until you find the keyword you want.
D) save the file
"W": Enter "w" in the colon to save the file.
E) Leave vi
Q: Press q to exit. If you cannot exit vi, you can follow q with 「!」 Force exit vi.
"Qw": it is generally recommended to use it with "w" when leaving, so that files can be saved when exiting.
5. vi command list
1. The following table lists some key functions in command mode:
H
Move the cursor one character left
L
Move the cursor one character to the right
K
Move the cursor up a row
J
Move the cursor down a row
^
Move the cursor to the beginning of the line
0
Number "0", move the cursor to the beginning of the article
G
Move cursor to the end of the article
$
Move the cursor to the end of the row
Ctrl + f
Forward screen flip
Ctrl + B
Flip back
Ctrl + d
Front Half Screen
Ctrl + u
Flip back half screen
I
Insert characters before the cursor position
A
Add the next character at the cursor position
O
Insert a new row and start from the beginning of the row.
ESC
Return from input to command status
X
Delete characters after the cursor
# X
# Characters After deleting the cursor
X
(Uppercase X), delete the character before the cursor
# X
Delete # characters before the cursor
Dd
Delete the row where the cursor is located
# Dd
Delete # rows from the number of rows where the cursor is located
Yw
Copy a word at the cursor position
# Yw
Copy the # characters at the cursor position
Yy
Copy a line at the cursor position
# Yy
Copy the number of rows from the cursor
P
Paste
U
Cancel operation
Cw
Change the cursor position.
# Cw
# Words for changing the cursor position
Some commands in the following Table travel command mode
W filename
Save the file being edited as filename
Wq filename
Save the file being edited as filename and exit vi
Q!
Discard all modifications and exit vi
Set nu
Show row number
/Or?
Search, enter the content to search after/
N
And/or? If the search content is not the keyword, press n or backward (and/) or forward (and? Continue searching until it is found.