Remove Comments from File

Example to remove comments from a file.

cat /etc/dspam.conf | grep -v '^#' | grep -v '^$'

This removes the lines with #

grep -v '^#'

This removes the blank lines.

grep -v '^$'

Keywords: bash linux

blog comments powered by Disqus