Home  >  Article  >  Operation and Maintenance  >  How to modify and save files in linux

How to modify and save files in linux

王林
王林Original
2019-12-26 13:40:024541browse

How to modify and save files in linux

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

How to modify and save files in linux

Then execute the command vi index.php

How to modify and save files in linux

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

How to modify and save files in linux

Write an echo code to save Esc: wq This is to save, press Enter to save

How to modify and save files in linux

After the saving is completed, open the file again and you will find that you have just The written code has been saved inside.

How to modify and save files in linux

Command not to save Esc: q! This is not to save

How to modify and save files in linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn