Linux command line shortcut keys

Source: Internet
Author: User
Tags clear screen

Transferred from: http://www.cnblogs.com/webzhangnan/p/3221410.html

"Move Cursor"

CTRL + A flag moves to the beginning of the line. It can be used in most text editors and in the URL fields of Mozilla.
Ctrl+e move the cursor to the end of the line. It can be used in most text editors and Mozilla's URL fields.

ALT+F cursor moves forward one word
ALT+B cursor moves backward one word

CTRL+F cursor moves forward one character, equivalent to
CTRL+B cursor moves backward one character, quite with <–

Esc+b move to the beginning of the current word
Esc+f move to the end of the current word

"Screen Action"
Ctrl+u scrolling up half screen
Ctrl+d Scroll down half screen
[Ctrl] + [l] = clear screen. This shortcut works the same as typing clear at the command line.

"Cut, delete, paste"
Ctrl+u all characters before the cursor in the command line is clipped (excluding itself)
Ctrl+k all characters (including itself) after the cursor in the command line are clipped [end of line]

Ctrl+y Paste the character you just deleted

CTRL + C Delete entire row

Ctrl+d Delete the character at the cursor ctrl+h Delete the previous character where the cursor is located

Ctrl+w A word that precedes the clipping cursor (with spaces, punctuation, and so on) alt+d the word after the cut cursor esc+w delete the character that precedes the cursor to the end of its word (delimited by spaces, punctuation, and so on)

"Character editing"
Alt+u convert the current word to uppercase
Alt+l convert the current word to lowercase
Alt+c to capitalize the current vocabulary into the first character
CTRL + V inserts special characters, such as ctrl+v+tab into the TAB key (input control word such as CTRL + V, will enter M)
Esc+t reverses the position of the cursor and its adjacent words
Ctrl+t reverses the position of the character where the cursor is located, and moves the cursor to the next character (two characters before the swap cursor)
Alt+t Exchange Current and previous word position
CTRL + (x u) hold CTRL while you press X and u again to undo the action you just made

"Command History"

History displays a list of command histories. Type it in the shell prompt to display the top 1000 numbered commands that you typed. To display a shorter command history, type a number in the empty space after you have entered the historical F. For example: History 20.
↑ (ctrl+p) shows the previous command (the command history you typed in the current directory)
↓ (CTRL + N) Displays the next command

!! (execution) Previous command

LS!$ executes command ls, and the parameter of one of the above commands is its parameter

!num the NUM command that executes the command history list

!-N Countdown Nth History command

!-n:p Print the previous command (not executed)

!-n:gs/str1/str2/– replaces the str1 of the last nth command with STR2 and executes (replaces the first only if no G is added)

!? String? Executes the most recent command with string strings
Ctrl+r then enter several characters, start searching up for the command that contains the character, and continue to press Ctrl+r to search for the previous matching command
[not working properly, conflict with pending current Shell] Ctrl+s is similar to ctrl+r, just forward retrieval
alt+< History list First item
alt+> History list Last item

"Terminal Control"

Tab: Command line Auto-complete. You can use this command when using shell hints. Type the first few characters of a command or file name, and then press the [Tab] key, which automatically complements the command or displays all commands that match the characters you type.

CTRL + C terminates the program that is currently running.

Ctrl+s suspending the current shell ctrl+q re-enabling the suspended shell

[Ctrl] + [d] = Log off (and close) from the shell prompt. With this shortcut, you don't have to type exit or logout.

Exit = Logoff. Type it in the shell prompt to log off the current user or root user account. [Ctrl] + [l] = clear the screen. This shortcut works the same as typing clear at the command line. Clear = Clears the shell prompt screen. Typing it at the command line clears all the data displayed in this shell prompt screen.

[Ctrl] + = Clears the current line. If you are working under a terminal, use this shortcut to clear the characters from the cursor to the beginning of the line.

reset = Refresh the shell prompt screen. If the character is not clear or garbled, typing this command at the shell prompt refreshes the screen.

"Window or System"

[Ctrl] + [Alt] + [Backspace] = kills your current X session. Kill the graphical desktop session and return you to the login screen. If the normal exit step does not work, you can use this method. (sometimes in the X-window due to the program error, so that the mouse keyboard does not work, this time do not worry, because in Linux almost will not like in the win 9x as the vicious panic, you only need to type Ctrl+alt+backspace key can return to the character interface. )

[Ctrl] + [Alt] + [Delete] = Shut down and re-boot Red Hat Linux. Close your current session and reboot the OS. Use this method only if the normal shutdown step does not work.

[Ctrl] + [Alt] + [Fn] = Toggle screen. [Ctrl] + [ALT] + one of the function keys will display a new screen. According to the default settings, from [F1] to [F6] is the shell prompt screen, [F7] is a graphical screen.

[Alt] + [Tab] = switch tasks in a graphical desktop environment. If you have more than one application open at the same time, you can use [Alt] + [TAB] to switch between open tasks and applications.

"Mouse GUI Action"

[middle mouse button] = paste the highlighted text. Use the left mouse button to highlight the text. Point the cursor to the place where you want to paste the text. Click the middle mouse button to paste it. In a two-button mouse system, if you configure the mouse to simulate the third button, you can click the left and right mouse buttons to perform the paste.

    • Left-click-and-drag Mouse: Select and copy to Clipboard.
    • Click middle mouse button: Paste with the contents of the Clipboard.
    • Meta-key (Emacs terminology) is traditionally used in Left-alt-key

Linux command line shortcut keys

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.