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