Given:
code
in /etc/nginx/sites-available/mySite.conf
. We know that
#Code
means it will get ignored. But how if I want to comment out:
Code
Code
Code
Code
without using #
? I have people see use '''
in python to comment out multiple lines. Does this work for Linux config files as well?
You can use this also to add comments to your config files to describe what you changed for later use. Whenever you want to comment a line, put a # in an appropriate place in a file. Anything beginning after # and ending at the end of the line won’t get executed. This comments out the complete line.
Lines get commented out do deactivate them. You can use this also to add comments to your config files to describe what you changed for later use. Whenever you want to comment a line, put a # in an appropriate place in a file. Anything beginning after # and ending at the end of the line won’t get executed.
You can “uncomment a line” in a configuration file by removing the # at the start of the line. Or, to “comment out” a line, add a # character to the start of the line. (Note that some languages have different comment formats, so this may not be true if you’re working with a source code file.)
One reason to ignore all comment lines is to see relevant config settings of any particular conf file. As an example /etc/hdparm.conf contains 137 lines.
There's no standard "Linux config file" -- the syntax is totally dependent on what program is reading the file and how that program is parsing it.
Nginx recognizes only lines beginning with #
as comments. http://nginx.org/en/docs/beginners_guide.html#conf_structure
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With