Comment out the linux configuration file

Source: Internet
Author: User
Article Title: comment out the linux configuration file. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. Use grep-v "^ #" to remove the comment line, where-v is the opposite ^ # To represent the annotation line.

Eg. grep-v "^ #"/etc/vsftpd. conf (you can also use ">" to override the configuration file)

2. Sometimes it will be removed together with the empty line and completed with the pipe character (^ $ indicates the empty line)

Eg. grep-v "^ #" httpd. conf | grep-v "^ $"> vsftpd. conf

The above two grep filtering commands are used to filter out empty lines and annotation lines, and then append the remaining content to the original

In the configuration file vsftpd. conf. At this time, there will be no annotation lines or empty lines in the file ,,,,

Tip: We recommend that you do not use this method if you are not familiar with the configuration file. The annotation line in the configuration file is helpful.

In addition, we recommend that you back up the configuration file before changing the configuration file:

Cp-a httpd. conf httpd. conf. bak

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.