Linux Operations Phase II (II) VI editor

Source: Internet
Author: User

Linux operation and Maintenance Phase II (ii) VI Editor

VI Editor (full-screen plain text editor)

1. Command mode, insert mode, last line mode

2. a insert in the word specifier the cursor

a at the end of the line where the cursor is inserted

I insert in the word match either the cursor

i insert at the beginning of the line where the cursor

o insert a new line under the cursor

o insert a new line on the cursor

: w Save

: Q do not save exit

: Wq Save Exit

: q! Force Exit

: w file name Save As

3, the HJKL corresponds to the lower left upper right

GG File Header

end of g file

      ^         beginning

      $         End of Line

: N move to the first few lines

x Delete a single character

NX Delete N of characters

DD Delete a single line (or cut)

: n1,n2d Delete a specified range of rows

NDD Delete N Line

P after pasting to the cursor

P paste before the cursor

yy Nyy Copy

u Revoke

Ctrl+r Anti-Revocation

R The character at which the cursor is replaced

R start replacing at the cursor, <esc> End

: Set Nu Show Line Numbers

: Set Nonu do not display line numbers

: Syntax On|off Color Switch

      / content Find a string (n - down,n to look up )

: 1,10s/old/new/g Replace 1 to 10 rows of Old to be New

:%s/old/new/g replace the entire file. Old to be New

: 1,5s/^/#/g Note 1 to 5 lines (at the beginning of the # )

: 1,5s/^#//g Uncomment 1 to 5 lines

: 1,5s/^/\/\//g file Header Join //

Note:/g (all within range)

From Brother Lian Training


Linux Operations Phase II (II) VI editor

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.