You can run this command to strip the comments (line that begins with a #) and remove blank lines from a file in Linux :

cat /path/to/file  | grep -v ^# | grep -v ^$

Example:

To remove comment lines from squid.conf you can run the following command:

cat /etc/squid/squid.conf | grep -v ^# | grep -v ^$ > squid_stripped.conf

Page 1 of 11