How to use Duvi text editor under Linux system?

  The vi editor is a very standard editor under the Linux system. It is not inferior to any other latest editor. It is liked by many people. So do you know how to use the vi text editor under the Linux system? Today is new and modified as Let me give you a brief introduction.

  1. Create a new file: When the file does not exist, you can create an empty file by vi + file path + file name, enter any letter in the keyboard to enter the editing state, and then you can write in the file Related content.

  2. Modify a file: It is very similar to the newly created file. The file has been created, but the file is not known in the current directory. You can enter that directory by cd, and then use ls to list all files in the directory to confirm. When the file exists, just input letters on the keyboard to enter the editing state.

  3. Save the addition or modification: In the editing state, press the ESC key on the keyboard to exit the editing state, and then enter: wq in the command line to save.

  4. A .swp prompt file appears: In fact, it is the same as a temporary word file. Reopen a terminal and use rm -rf .a.txt.swp to delete the .swp file; or exit without saving, the command is: :q!.

Guess you like

Origin blog.51cto.com/15052541/2575947