First open the command console and find the file to be edited. Execute the command ls to see how many files there are below. I have an index.php file below
Then execute the command vi index.php
More free learning video tutorials to share: linux video tutorial
If you want to modify the content of this file at this time, press the 'i' key on the keyboard, and the bottom will change to INSERT, and you can modify it
Write an echo code to save Esc: wq This is to save, press Enter to save
After the saving is completed, open the file again and you will find that you have just The written code has been saved inside.
Command not to save Esc: q! This is not to save
Recommended related articles and tutorials: linux tutorial
The above is the detailed content of How to modify and save files in linux. For more information, please follow other related articles on the PHP Chinese website!