Linux Command Summary

Source: Internet
Author: User

Command Line is an important part of Linux. On the terminal, you can use commands to control the system to perform a series of operations, including running programs and editing files, which can almost replace the mouse. Of course, it is because there are too many commands and it is very troublesome to remember. Because the company's products use the Linux system, we also learned a lot of Linux commands at ordinary times, but it's just a glimpse. I just read a Linux Standard tutorial from my colleague and read a lot of useful commands.

In addition, commands in Linux are similar to code or English and in a certain format. Command + Option + parameter. For English, it is the verb + adjective + object.

1. command line auto-completion -- Tab key

This was useful when I first came into contact with Linux. For example, CD/m <tab> automatically displays the folders starting with m under the root directory ("/" indicates the root directory). If there is only one, the complete display of CD/mnt/

2. Edit the command line

CTRL + A: move the cursor to the beginning of the line. (I have been searching for this command because the home/end in Windows is obviously useless. Therefore, it is still very troublesome to remember. We need to distinguish windows .)

CTRL + E: move the cursor to the end of the row.

CTRL + K: delete the part from the cursor to the end of the row.

CTRL + u: delete the part from the cursor to the beginning of the row.

CTRL + W: delete the part from the cursor to the beginning of the current word.

ATL + D: delete the part from the cursor to the end of the current word.

Alt + A: move the cursor to the current word header.

Alt + E: move the cursor to the end of the current word.

CTRL + Y: insert the recently deleted word.

! $: Repeat the last parameter of the previous command. (This command is not applicable to me. It has a short hand and the shift key on the keyboard is enough to reach the keys 1 and 4. It is better for me to use the tab directly. Of course, the situation should also be divided .)

3. If the parameters in the Command column contain file names, you can use a common configuration character. *? [Character combination] [! Character combination]

*: Represents any character. This explains why the command RM * can delete all files in the current directory. Because * can replace all file names.

? : Represents any single character. That is, one? Replace one character in the file name. Rm ?. Bak deletes all files with only one character and extension. Bak. Unlike *. Bak, you can delete all. BAK files.

[Character combination]: The characters in brackets match. That is, the file name contains characters in brackets.

[! Character combination]: All characters that are not in the brackets match .! It indicates reverse lookup. The meaning is clear at a glance.

4. Use of the VI Editor

The VI editor is a standard editor for all Linux systems.

There are three modes: Command mode, insert mode, and last line mode.

Command mode: (Press ESC to exit the insert mode to enter the command mode .) Open the file with vi. By default, the file enters the command mode. You can use the command to enter the insert mode or the last line mode.

Insert mode: You can enter text only in insert mode. In command mode, press I to enter the insert mode. (Press ESC to return to command line mode .)

Last line mode: Save the file or exit the VI editor. You can also set the editing environment. In command mode, press: To enter the last line mode.

In fact, the command mode is not much different from the last line mode. I always thought that WQ is also the command mode.

5. I will summarize so much for the time being. Finally, I told a joke that a colleague was dismissed when I came to our company... I heard from my colleagues later on his brilliant deeds-Programming With VI. Haha

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.