How to open a file and save it in linux
How to open a file and save it in linux? I believe that many novice rookies are ignorant of the knowledge that linux opens files and saves. Through the summary of this article, I hope you can gain more. The following information is about? The content of.
For example, to modify the host file
First use the vi / etc/hosts command to open the read mode of the hosts file, press o to enter edit mode, and insert a line after the current location.
After entering the content, press ESC to exit edit mode and enter reading mode.
Command: W save file
Command: Q exit.
Recommended video learning tutorials: linux video tutorials
Edit mode commands:
I: insert at current location
A: append after the current location
O: insert a row after the current location
I: insert in the header
A: append at the end of the line
O: insert a row in front of the current location
Read mode command:
W save the file
W filename is saved as a filename file
Q exit
: q! Forcibly withdraw
: w! Forced writing
Wq save exit
X same as wq
The above is how to open a file and save the knowledge summary in linux, the content is more comprehensive, the editor believes that there may be some knowledge points that we may see or use in our daily work. I hope you can learn more from this article.