Introduction to Linux shortcut keys

Source: Internet
Author: User

All of the following commands are valid under Linux/unix's shell, which is dominated by bash. In case of discrepancies, take your own server as the subject. Linux referred to herein is mainly referred to as Rhel/centos.

Ctrl + a switches to the command line start

This operation is the same as the home implementation, but the home is not available in certain UNIX environments, it can be used, the VIM under Linux is also valid, and in many of the Windows file editors, This is also valid.

Ctrl + E To switch to the end of the command line

This operation is the same as the end implementation, but the end key is not available in some UNIX environments and can be used with this combination; Vim under Linux is also valid, and in many of the Windows file editors, this is also valid.

Ctrl + L Clears the contents of the screen, the effect is the same as clear

Ctrl + U clears the contents before the cut cursor

Ctrl + W Clears the contents of the cursor before removing it in words and commands

C TRL +xx the command to move the cursor at the beginning and current position of the command is useful, and is also valid in Nslookup. I sometimes see colleagues in a word a word of the delete shell command, very crash! You can actually use a CTRL + U to fix it.

Ctrl + K cut clears the contents of the cursor

Ctrl + y paste the character that you just deleted

This command is more powerful, the deleted characters may be a few string , but can be very Can be a line of command.

Ctrl + R is found in the history command (this is very easy to use, enter the keyword to bring up the previous command)

This command I strongly recommend, sometimes history more time, want to find a more complex, directly here, the shell will automatic to find and invoke, convenient.

Ctrl + C terminate command

Ctrl + D exit shell,logout

Ctrl + Z to run in the background

However, Ctrl + Z goes to the background The running process terminates after the current user exits, so use this instead of the Nohup command &, because the Nohup command is that the process continues to run after the user exits, and now many scripts and commands require that the root exit is still valid. Under

is not too familiar, I used a lot of operation:

!! Repeat the last command

history displays all of your executed numbering + historical commands. This can match! Edit to execute a command

↑ (ctrl+p) Show previous command

↓ (CTRL + N) show next command

!$ show system last parameter

ALT +? Lists the files in the current directory, equivalent to the LS

Alt+num (num stands for any positive integer), enter any character, such as Y, to output num y

Alt +d Delete the word after the cursor

Alt +backspace Delete Light tag string

Finally this is useful, for example I use Cat/etc/sysconfig/network-scripts/ifconfig-eth0 first, then I want to use vim to edit. The general practice is to first use ↑ to display the last command, then use home to move to the top of the command, delete the cat, and then enter the VIM command. In fact, you can use Vim!$ instead.

Development and management of the words, master the above usage, basically work is very efficient; In the end, you will inadvertently find, your fingertips, many complex instructions you will be easy to fix.

Appendix: Shortcuts for desktop environments under Linux

The following instructions are valid under Linux/unix desktop environment (GNOME), and are subject to your own server:

Alt + F1 like the win key under Windows, open the app in Gnomeprogram"Menu (applications)

Alt + F2 similar to the win + R key combination under Windows, running the application in GNOME

Ctrl + Alt + d similar to Windows's win + D key combination, display desktop

Ctrl + Alt + L Lock the desktop and start the screen saver

ALT + TAB with ALT + TAB key in Windows, switch between different program windows

Printscreen Full Screen screenshot

Alt + printscreen Current window grab

Ctrl + Alt +→/← Switch between different workstations

Ctrl + Alt + Shift +→/← move the current window to a different workbench

CTRL+ALT+SHIFT+FN terminal n or analog terminal n (n and N are number 1-6)

Ctrl+alt+shift+f7 Back to Desktop

Ctrl+alt+shift+f8 Unknown (terminal or analog terminal)

Window action shortcut keys

Alt + F4 Close window

Alt + F5 to cancel the maximized window (restores the original size of the window)

Alt + F7 Move window (note: Not valid in the maximized State of the window)

Alt + F8 Change window size (Note: Not valid in the maximized State of the window)

Alt + F9 Minimized window

Alt + F10 Maximized window

Alt + Space Open the Control menu of the window (click the menu that appears in the top left corner of the window)

Common shortcut keys in applications

The following does not apply to all programs. Can be compared with the shortcut keys under Windows:

CTRL + N New Window

Ctrl+x Cut

CTRL + C copy

Ctrl + V Paste

CTRL + Z undo Previous action

Ctrl+shift+z redo the first step of the undo operation

Ctrl+s Save

FileBrowser

Ctrl+h Show hidden files (toggle key)

Ctrl+t new Label

Ctrl+page up previous label

Ctrl+page down next label

Alt+n Switch to nth label (n is a number)

Introduction to Linux 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.