How do i take out the commented lines in the
squid.conf file and make the newly created squid file the default config file for my squid proxy server ?
sed -i.bak '/^#/d' /etc/squid/squid.conf
The original file will be saved as
/etc/squid/squid.conf.bak. If you don't want to save the original file, use:
sed -i '/^#/d' /etc/squid/squid.conf
grep -v '^#' /etc/squid/squid.conf > /etc/squid/squid.conf.bak && mv /etc/squid/squid.conf.bak /etc/squid/squid.conf
I will not suggest you to just blindly remove all the lines starting with
# as they may contain various important info/suggestions.