Home > Article > Operation and Maintenance > How to save and exit in linux
Vi is the standard editor under Unix and Linux systems. It was founded by Bill Joy of the University of California, Berkeley. Once you learn it, you will be able to navigate the Linux world smoothly. Basically vi can be divided into three states, namely command mode, insert mode, and bottom line mode.
In Linux command line mode, press the colon key to enter bottom line mode, so the command to save and exit is: wq
The following is expanded knowledge:
Edit mode
After using vi to enter the text, press i to start editing the text
Exit vi and save the file
In the command line mode, press the colon key to enter the bottom line mode, for example:
:w (save the current file)
: w filename (save the file with the specified file name "filename")
:wq (save and exit vi)
:wq filename (save the file being edited Save as "filename" file and exit vi)
:q (Exit vi)
:q! (Force vi to exit without saving)
:x (Equivalent to: wq function)
The above is the detailed content of How to save and exit in linux. For more information, please follow other related articles on the PHP Chinese website!