Shortcuts used in Ubuntu terminal

Source: Internet
Author: User
Tags clear screen

Many of the operations in Ubuntu are very fast in the terminal (Terminal), remembering that some shortcuts are more handy to operate. The shortcut key to open the terminal in Ubuntu is Ctrl+Alt+T . Some of the other common shortcut keys are as follows:

shortcut Keys function
Tab Auto-complete
Ctrl+a Move cursor to start position
Ctrl+e Cursor moves to the very end
Ctrl+k Delete all content from here to the end
Ctrl+u Remove all content from here to start
Ctrl+d Delete current character
Ctrl+h Delete the previous character of the current character
Ctrl+w Delete the word here to the left
Ctrl+y Paste by Ctrl+u , Ctrl+d , Ctrl+w delete the word
Ctrl+l Equivalent to clear, i.e. clear screen
Ctrl+r Find History command
Ctrl+b Move the cursor back
Ctrl+f Move Cursor Forward
Ctrl+t Positions the character of the cursor position and the previous character in the position Exchange
Ctrl+& ctrl+h ctrl+d ctrl+w What to restore or delete
Ctrl+S Pause Screen Output
Ctrl+Q Continue screen output
Ctrl+Left-Arrow Cursor moves to the first word of the previous word
Ctrl+Right-Arrow The cursor moves to the ending of the next word
Ctrl+p Show cache commands up
Ctrl+n Show Cache command down
Ctrl+d Close the terminal
Ctrl+xx Move at EOL and current cursor position
[email protected] Show possible hostname completion
Ctrl+c Terminate process/Command
Shift+ Up or down Terminal scroll up and down
Shift+PgUp/PgDn Scroll down the end of the page
Ctrl+Shift+n New terminal
alt+F2 Input Gnome-terminal Open Terminal
Shift+Ctrl+T Open a new tab page
Shift+Ctrl+W Close tabs
Shift+Ctrl+C Copy
Shift+Ctrl+V Paste
Alt+数字 Switch to the corresponding tab page
Shift+Ctrl+N Open a new terminal window
Shift+Ctrl+Q Tube Wall Terminal window
Shift+Ctrl+PgUp/PgDn Move right to Left tab page
Ctrl+PgUp/PgDn Toggle tab Page
F1 Open Help Guide
F10 Activating the menu bar
F11 Full Screen Toggle
Alt+F Open the File menu
Alt+E Open the Edit menu
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

Other tips include: at the terminal window command prompt, press the TAB key two times, or press the ESC key three times, or press Ctrl+i to display all the commands and the tool name. The application key, which is the key to the left of the right Ctrl key on the keyboard, acts as a right mouse button.

===== Terminal Terminal =====
CTRL + ALT + T: Open terminal
TAB: Auto-complete command or file name
CTRL + SHIFT + V: Paste (does not need to copy the action in Linux, the text is selected to be copied automatically)
CTRL + SHIFT + T: New tab page
CTRL + D: Close tabs
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 line
CTRL + C: Terminates the current task
CTRL + Z: Put the current task in the background (equivalent to adding & after running the command)
~: Indicates the user directory path

===== If you open a program =====
Take "System Configuration" as an example, first press Super + A,super that is win key, then switch to Chinese input method, enter "System Configuration", press ENTER to open the program. Then press TAB to browse the sub-configuration program in the system configuration.

===== Desktop =====
ALT + F1: Focus to the left side of the desktop task navigation bar, you can press the up and down keys navigation.
ALT + F2: Run command
ALT + F4: Close window
ALT + TAB: Toggle program window
ALT + Space: Open Window menu
PRINT: Desktop

Super: Open Dash Panel, can search or browse items, default has a search box, press the "down" arrow key to enter the browsing area (super Key refers to the win key or the command key of Apple Computer)
Press CTRL + TAB in the dash panel: switch to the next sub-panel (you can search for different types of items, such as programs, files, music)
SUPER + A: Search or browse program (application)
SUPER + F: Search or browse files (file)
SUPER + M: Search or browse music files

===== Orca read screen software =====
Start Orca:super + A, then enter Orca, and then return
ORCA + Spaces: Display Preferences dialog box (ORCA key refers to insert insert key or CAPS LOCK case conversion key, depending on settings)
ORCA + t: Read current time
ORCA + TT: Read current date
ORCA + S: Toggle synthetic Voice Switch
ORCA +/: Read title
ORCA +//: Read the status bar
ORCA + semicolon: Read the entire file
For more shortcuts, refer to the Key Bindings tab of Orca preferences.

===== Firefox Browser =====
Ways to get into Firefox:
1. SUPER + A, then press Firefox, enter. This is the search app running in the dash panel. In fact, just press fir to locate the Firefox program.
2. ALT, then press Firefox, enter. This is equivalent to running a command at the command line.
3. Press Firefox& in the terminal, and enter. This applies to users with the terminal as the main operating window, and the TAB key can also be used to automatically complete the command (just enter the first few letters and then press the TAB key). & In the shell is the background to run the meaning, so that the terminal will not be exclusive Firefox.
CTRL + T: New tab page
CTRL + W: Close tabs
CTRL + SHIFT + T: Reopen a recently closed tab
CTRL + TAB: Switch to next tab
CTRL + SHIFT + TAB: Switch to previous tab page
ALT + [1-8]: Skip to developing tabs
ALT + 9: Skip to the Last tab page
CTRL + L: Jump to the Address bar
ESC: Stop loading the current page
CTRL + K: Skip to search engine input box
CTRL + F: Search in the current page
/: Quick Find. Many programs in Linux, such as VI, man, and less, use/as shortcut keys for searches, and can be found using regular expressions. However, there is no function of regular expression search in Firefox.
CTRL + D: Favorites to Bookmarks
ALT + LEFT ARROW key: Back
ALT + V: Forward
CTRL + Q: Exit

===== gedit Text Editor =====
Start Gedit:super + A, then press gedit, enter
CTRL + N: New Document
CTRL + W: Close document
CTRL + S: Save
CTRL + SHIFT + S: Save As
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 =====
Ways to start Nautilus:
1. SUPER + 1, this method only applies if the Nautilus is not changed in the position of the left quick start.
2. SUPER + A, then input nautilus, then enter
F2: Renaming
CTRL + 1: Icon view
CTRL + 2: List view
CTRL + T: New tab page
CTRL + W: Close tabs
CTRL + D: Favorites to Bookmarks
CTRL + Q: Exit
Nautilus also has many shortcut keys that are consistent with Firefox.

===== Rhythmbox Audio Player =====
ALT + LEFT ARROW key: Previous
CTRL + UP ARROW: Increase volume
CTRL + Lower Arrow: Reduce volume
CTRL + U: Shuffle
CTRL + R: Play repeatedly
CTRL + Q: Exit



Vi/vim Basic Use Method
The VI Editor is the standard editor for all UNIX and Linux systems, and its power is not inferior to any of the latest text editors, here is simply a brief introduction to its usage and a small number of instructions. Because the VI editor is exactly the same for any version of UNIX and Linux systems, you can learn more about it in any other place where VI is introduced. VI is also the most basic text editor in Linux, after learning it, you will be in the world of Linux unimpeded.

1, VI of the basic concept
Basically, vi can be divided into three states, namely command mode, insert mode (and bottom line mode), and the function of each mode is as follows:

1) command-line mode

Controls the movement of the screen cursor, the deletion of characters, words, or lines, moving and copying a section and entering insert mode, or to last line mode.

2) insert mode

Only in the Insert mode, you can do text input, press "esc" to return to the command line mode.

3) Bottom line mode

Save or Exit VI, or you can set the editing environment, such as looking for a string, listing line numbers ... such as

In general, however, we simplify the VI into two modes when we use it, that is, the bottom row mode (last line mode) is also counted as the command-line pattern.

2, VI of the basic operation
A) Enter VI

After the system prompt symbol to enter VI and file name, go to the VI Full screen editing screen:

$ VI myfile

However, it is important to note that after you enter VI, you are in command mode and you want to switch to insert mode to enter text. First Use VI people will want to use the next key to move the cursor, the result of the computer has been a beep, the gas to death, so enter the VI, do not move, switch to "insert mode" and then!

b) switch to insert mode to edit the file

Press the letter "i" under command mode to enter "Insert Mode", and you can start typing the text again at this point.

c) Toggle of Insert

You are currently in "Insert Mode", you can only enter text, if you find the wrong word! To move back with the cursor key, delete the word, then click the "esc" key to go to "command mode" and then delete the text.

d) Exit VI and save the file

Under Command mode, click the ":" colon key to enter "last line mode", for example:

: w filename (enter "w filename" to save the article with the filename you specified)

: wq (input "wq", save and Exit VI)

: q! (Enter q!, do not save the mandatory exit VI)

3. Command mode function key
1). Insert mode

Press "i" switch into insert mode "insert mode", press "I" into the insertion mode is the beginning of the cursor from the current position to enter the file;

After pressing "a" into insert mode, the text is entered from the next position at the current cursor position;

When you press "o" to enter insert mode, you insert a new line and enter text from the beginning of the beginning.

2). Switch from insert mode to command line mode

Press the "esc" key.

3). Move the cursor

VI can be directly on the keyboard with the cursor to move up and down, but the normal VI is the lowercase English letter "h", "j", "k", "l", respectively, control the cursor left, bottom, upper, and right one grid.

Press "ctrl"+"b": The screen moves one page to the back.

Press "ctrl"+"f": The screen moves one page to the front.

Press "ctrl"+"u": The screen moves the half page toward the back.

Press "ctrl"+"d": The screen moves the half page toward the front.

"0" by number: Moves to the beginning of the article.

Press "g": Move to the end of the article.

Press "$": Moves to the end of the line where the cursor is located.

Press "^": Moves to the beginning of the line where the cursor is located

Press "w": Cursor jumps to the beginning of the next word

Press "e": Cursor jumps to the end of the next word

Press "b": Cursor back to the beginning of the last word

Press #l: The cursor moves to the first # position of the line, such as: 5l,56l.

4). Delete text

"x": Each time you press the cursor, delete the "after" character at the position where the pointer is located.

#x: For example, "6x" represents the "after" 6 characters of the location where the cursor was deleted.

"x": Uppercase X, each time it is pressed, deletes the "front" character at the location of the cursor.

"#X": for example, "20x" represents the "front" 20 characters of the location where the cursor was deleted.

"dd": Delete the line where the cursor is located.

"#dd": Deletes the # line starting at the line where the cursor is located

5). Copy

"yw": Copies the characters from the cursor to the end of the word into the buffer.

"#yw": Copy # words to Buffer

"yy": Copy cursor line to buffer.

"#yy": for example, "6yy" represents a copy of 6 lines of text from the line where the cursor is located.

"p": Paste the characters in the buffer to the cursor location. Note: All copy commands related to "Y" must be mated with "P" to complete the copy and paste function.

6). Replace

"r": Replaces the character at which the cursor is located.

"r": Replaces the character where the cursor is located until the "esc" key is pressed.

7). Restore/Undo/redo Last action

"u": If you mistakenly execute a command, you can press "u" immediately to undo the last action. Press multiple times "U" to perform multiple undo.

8). Change

"cw": Change the word-to-tail at the cursor location

"c#w": For example, "c3w" represents a change of 3 words

9). Jump to the specified line

"ctrl"+"g" lists the line number of the line where the cursor is located.

"#G": for example, "15g", which means moving the cursor to the beginning of the 15th line of the article.

4. Next line Mode command brief
Before using "last line mode", remember to press "esc" to make sure you are under "command mode" and then press ":" Colon to enter "last line mode".

A) List line numbers

"set nu": After you enter "set nu", the line numbers are listed before each line in the file.

B) jump to a line in the file

The "#":"#" number represents a number, enter a number after the colon, and then press ENTER to jump to the line, such as entering the number 15, and then enter, you will jump to the 15th line of the article.

C) Find characters

"/Keyword: First press the"/"key, and then enter the character you want to look for, if the first keyword is not what you want, you can always press"n"will look back to the keyword you want.

"? keyword": Press "?" first Key, and then enter the character you want to find, if the first keyword is not what you want, you can always press "n" will look forward to the keyword you want.

D) Save the file

"w": Enter the letter "w" the colon to save the file.

E) Leave VI

"q": Press "q" is to exit, if you cannot leave VI, can be "q" followed by a "!" Forced to leave VI.

"qw": Generally recommended to leave, use with "w", so you can also save the file when exiting.

5. VI Command List
1. The following table lists the functions of some keys in the command mode:

Move left cursor one character

Move the cursor one character to the right

Move the cursor up one line

Move the cursor down one line

Cursor moves to the beginning of the line

Number "0", the cursor moves to the beginning of the article

Cursor moves to the end of the article

Move cursor to end of line

Flip the screen forward

Flip the screen backwards

Turn Half-screen forward

Turn Back half screen

Insert a character before the cursor position

The next character at the cursor position begins to increment

Insert a new row, starting at the beginning of the line

Fallback from input state to command state

Delete the character following the cursor

# characters after the cursor is deleted

(uppercase x), delete the character in front of the cursor

Delete the # characters before the cursor

Delete the line where the cursor is located

Remove the # line from the number of lines that the cursor contains

Copy a word where the cursor is located

Copy the # Word where the cursor is located

Copy a row where the cursor is located

Copy the # line from the number of lines where the cursor is located


Cancel operation

Change a word in the position of your cursor

Change the # Word where the cursor is located

The following table lists some of the instructions in the line command mode
W filename
Save the file you are editing as filename

WQ filename
Save the file being edited as filename and exit VI

Discard all changes, exit VI

Set Nu
Show line Numbers

Find, enter what you are looking for in/after

with/or, if the search is not the keyword you are looking for, press N or backwards (with/to) or forward (with?) to continue looking until you find it.

Shortcuts used in Ubuntu terminal

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: 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.