Skip to content

Remove all comments and empty lines

cpx March 18, 2010 1 min read Bash/BASH

Grep will remove all comments and sed will remove all empty lines

# grep -v "^#" /etc/squid/squid.conf | sed -e '/^$/d'

Same with sed

# cat /etc/squid/squid.conf | sed '/ *#/d; /^ *$/d'

Be the first to comment

protected · no tracking

0 comments