Common shortcut keys for editing in Linux Command lines (1)

Source: Internet
Author: User

This article describes how to edit shortcuts for Linux Command lines.

Linux Command Line editing shortcut:

History display command history list

← (Ctrl + p) display the previous command

Hide (Ctrl + n) display the next command

! Num: The num command in the History list.

!! Run the previous command

!? String? Execute the latest command containing string strings

Ctrl + r enter several characters and start to search for the command containing the character up. Continue to press Ctrl + r to search for the previous matched command.

Ctrl + s is similar to Ctrl + r, only forward Retrieval

Alt + <first item in the History List

Alt +> last item in the History List

Ctrl + f move the cursor one character forward, equivalent to->

Ctrl + B move the cursor one character backward, equivalent to <-

Alt + f move a word forward with the cursor

Alt + B Move a word behind the cursor

Ls! $ Execute the ls command and set the parameters of the preceding command

Ctrl + a move to the beginning of the current row

Ctrl + e move to the end of the current row

Esc + B Move to the beginning of the current word

Esc + f move to the end of the current word

Ctrl + l clear screen

Ctrl + u cut all the characters before the cursor in the command line, excluding itself)

Ctrl + k cut all the characters after the cursor in the command line, including itself)

Ctrl + d Delete the character at the cursor

Ctrl + h Delete the character before the cursor

Ctrl + y paste the deleted character

Ctrl + w cut a word before the cursor is located with space, punctuation, etc. as the separator)

Alt + d cut words after the cursor

Esc + w deletes the characters before the cursor is located and ends with spaces and punctuation marks as separators)

Ctrl + t flip the cursor and its previous character location, and move the cursor to the next character

Alt + t exchange the current and previous word locations

Alt + u converts the current word to uppercase

Alt + l convert the current word to lowercase

Alt + c converts the current word into uppercase letters

Ctrl + v Insert special characters, such as Ctrl + v + Tab to add the Tab character key

Esc + t place the cursor and its adjacent words upside down

Ctrl + c Delete the entire row

Ctrl + (x u) press Ctrl and then press x and u to cancel the previous operation.

Ctrl + s suspend the Current shell

Ctrl + q restart the suspended shell

[Ctrl] + [Alt] + [Backspace] = kill your current X session. Kill the graphic desktop session and return you to the logon screen. If the exit step does not work, you can use this method.

[Ctrl] + [Alt] + [Delete] = shut down and reboot Red Hat Linux. Close your current session and reboot the OS. This method is used only when the normal shutdown step does not work.

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

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

[Ctrl] + [a] = move the cursor to the beginning of the line. It can be used in most text editors and Mozilla URL fields.

[Ctrl] + [d] = logout and close from shell prompt ). You do not need to enter exit or logout.

[Ctrl] + [e] = move the cursor to the end of the row. It can be used in most text editors and Mozilla URL fields.

[Ctrl] + [l] = clear the terminal. This shortcut works the same as typing clear in the command line.

[Ctrl] + = clear the current row. If you work in a terminal, use this shortcut to clear the characters from the cursor to the beginning of the line.


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.