How Linux vi saves the edited file

Source: Internet
Author: User

Press ESC to return to command mode, enter: W to save, or enter: wq! Save the file and exit.

Here is the Save command:

: W saves the file but does not exit VI.

: W file saves the modification to file and does not exit VI.

: w! Forced to save, do not introduce VI.

Expand:

Use of Vi/vim

Basically Vi/vim is divided into three modes, namely command mode, input mode and bottom line command mode. The three modes of action are:

Command mode:

The user has just started Vi/vim and entered command mode.

In this state, the keystrokes are recognized by VIM as commands rather than as input characters. For example, we press I at this time and do not enter a character, I is treated as a command.

Here are a few common commands:

I switch to input mode to enter characters.

x deletes the character at which the current cursor is located.

: Switch to Baseline command mode to enter commands at the bottom of the line

How Linux vi saves the edited file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.