August 30 Sixth session Linux text editing tools Vim's use job

Source: Internet
Author: User

1 , how to change the automatically indented characters from the default eight to four

: Set tabstop=4

2 , copy the/etc/grub2.cfg configuration file to the/tmp directory, and use the Find and replace command to delete the beginning blank character in the file

CENTOS6 Copy the/etc/grub.conf

:%[email protected]^[[:space:]]@@g

3 , copy the/etc/rc.d/init.d/functions file to the/tmp directory, use the Find and replace command as a line that begins with a blank character in the file, add a # to the beginning of the header, and the original whitespace character must be preserved

:%[email protected]\ (^[[:space:]]\) @\1#@g

:%[email protected]^[[:space:]]@&#@g

4 , replace/etc/sysconfig/init with/var/log in the/tmp/functions file with the Find replacement command

:%[email protected]/etc/sysconfig/[email Protected]/var/[email protected]

5 , use the Find replacement command to delete all lines beginning with # in the/tmp/funtions file, and # followed by at least one white space character at the beginning of the line #

%[email protected]^#\ ([[: Space:]]\) @\[email protected]


August 30 Sixth session Linux text editing tools Vim's use job

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.