Modify file content in Linux system

1. Enter the file: vim file name

vim common.js

2. Find the location of the content to be modified:

(1) Press and hold shift and enter " : " to make the file queryable

(2) Enter " / " + the content to be modified , and press Enter (for example: to modify the server address and port number)

 

3. Modify the content

After locating the position to be modified, press the i key to become editable, and modify the content to be modified

4. Exit

Press the ESC key to exit the modification state

5. Save (not save) the modification:

        Save changes:

(1) Press and hold shift and enter " : " to make the file queryable

(2) Enter wq! carriage return

        Do not save changes:

(1) Press and hold shift and enter " : " to make the file queryable

(2) Enter q!

Guess you like

Origin blog.csdn.net/qq_51515673/article/details/124390606