How to edit and save files with VI under Linux

Source: Internet
Author: User

VI is a Linux terminal or console under the Common editor, the basic mode of operation is: VI/path/file name

For example, Vi/etc/fstab indicates that the contents of the/etc/fstab file are displayed. Use the page UP and PAGE DOWN keys on your keyboard to page up and down, press the INSERT key to see the word "insert" in the lower-left corner of the window to indicate that you are currently inserting an edit state, and then insert the contents from the keyboard into the cursor position, and then press the INSERT key and the lower left corner will have " Replace word, which means that the contents of the cursor position are replaced by the content entered from the keyboard when the edit state is currently replaced. When you are finished editing the content, press ESC and enter ": Wq" and then enter to save the exit.

If you do not want to save and exit directly, press the ESC key, enter ": q!", and then return. "Wq" means write and quit, that is, save exit; " q! " Indicates that the modify forced exit is ignored.

How to edit and save files with VI under Linux

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.