Characters commonly used in shell scripts and shortcut keys in the VIM editor

Source: Internet
Author: User

Common shortcuts in the command mode of the 1.vim editor

Command function

DD Delete (cut) the entire line where the cursor is located.

5DD Delete (cut) 5 lines starting at the cursor.

YY copies the entire line where the cursor is located.

5yy Copies the 5 lines starting at the cursor.

P Pastes the previously deleted (DD) or copied (yy) data into the cursor.

/String to search for the string from top to bottom in the text.

The string is searched in the text from bottom to top of the string.

N Displays the next string that the search command navigates to.

N Displays the previous string to which the search command is anchored.

U undo the last step operation

Common commands in the last-line mode of the 2.vim editor

Command function

: w Save

: Q exit

: q! Force quit (discard modifications to the text)

: wq! Force Save exit

: Set nu displays line number

: Set Nonu does not display line numbers

: Command to execute the command

: integer jumps to the row


3. File test: [operator file or directory name]

Operator Action

- D test is a directory.

- E tests whether a file or directory exists.

- F to determine whether the file is.

- R tests whether the current user has permission to read.

- W tests whether the current user has permission to write.

- x tests whether the current user has permission to execute.


4. Logic test: [expression 1] operator [expression 2]

Operator Action

&& logical with, "and" meaning.

|| The meaning of logic or, "or".

! Logical No.


5. Integer value comparison: [Integer 1 operator integer 2]

Operator Action

-eq judgment is equal to

-ne judgment is not equal to

-GT Judging whether it is greater than

-lt Judging whether it is less than

-le judgment is equal to or less than

-ge judgment is greater than or equal to


6. String comparison: [string 1 operator String 2]

Operator Action

= compares string contents to the same.

! = compares string contents differently.

- Z Determines whether the string contents are empty.


This article is from the "Linux Learning path" blog, so be sure to keep this source http://10243875.blog.51cto.com/10233875/1823616

Characters commonly used in shell scripts and shortcut keys in the VIM editor

Related Article

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.