1. grep will remove all comments and sed will remove all empty lines, thanks to David Klein for quick hint:
# grep -v "^#" /etc/squid/squid.conf | sed -e '/^$/d'
2. OR, try out sed (thanks to kotnik for small sed trick)
# cat /etc/squid/squid.conf | sed '/ *#/d; /^ *$/d'
ATUALIZADO - outra forma
$ egrep -v "^#|^$" [arquivo.conf_original] > [arquivo.conf_descomentado]



































