Home >Operation and Maintenance >Linux Operation and Maintenance >How to modify file content in linux
Modification method: 1. Use the "vim file name" command to enter the specified file; 2. Find the location of the content to be modified; 3. After finding the location, press the "i" key on the keyboard to enter the editing state and edit the file content Make modifications; 4. After modification, press the ESC key to exit the editing state and save the modifications.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
linux Modify file content
1. Enter the file: vim file name
vim /etc/httpd/httpd.conf
2. Find the location of the content to be modified:
(1) shift ":" to make the file queryable
(2) Enter / Query content (eg query Directory parameters, that is, /Directory)
eg Find the Directory parameter, comment out Require all denied, add Require all granted
3, Modify after finding the location: Press the i key on the keyboard to become editable
4. Exit after modifying the file content: Press the ESC key
5. Save the changes :
(1) shift ":" to make the file queryable
(2) Enter wq!
If you do not want to save the changes, you can:
(1) shift ":" to make the file queryable
(2) Enter q!
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of How to modify file content in linux. For more information, please follow other related articles on the PHP Chinese website!