Home>Article>Operation and Maintenance> How to modify the content of linux files
Modification method: 1. Use the "vim file name" command to enter the file; 2. Press the "shift ":"" key to enter the query state, and enter the "/query content" command to find the content location; 3. Press The "i" key enters the editable state and edits the file content; 4. Press the "ESC" key to exit the editing state; 5. Use the "wq!" command to save the changes.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
How to modify the content of linux files
1. Enter the file: vim file name
Example:vim /test/vi.test
When you first open the file, Vim is in command mode. At this time, some information about the file will be displayed below the file. , including the total number of lines and characters of the file, as well as the current cursor position, etc.
2. Find the location of the content to be modified:
(1)shift ":"
, make the file queryable
(2) Enter/query content
(eg query Directory parameters, that is,/Directory
)
3. Modify after finding the location: Press thei
key on the keyboard to become editable
4. After modifying the file content, Press the ESC key to exit the editing state
5. Save changes:
Enterwq!
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of How to modify the content of linux files. For more information, please follow other related articles on the PHP Chinese website!