commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Removes comments and blank lines from configuration files, leaving only settings
There are 4 alternatives - vote for the best!
Use it with cat and '|' for know what is used in a conf file.
For example cat /etc/squid/squid.conf | sed -re '/^#/d ; s/#.*$// ; /^\s$/d' :
Show you what you use in your file conf.
It removes all comments and empty lines.
Empty lines are lines with nothing, a tab, or a space.
If you can do better, submit your command here.
You must be signed in to comment.