Home  >  Article  >  Operation and Maintenance  >  How to save and exit in linux

How to save and exit in linux

little bottle
little bottleOriginal
2019-05-29 17:26:0123718browse

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.

How to save and exit in linux

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!

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