[sed]【1行野郎】行頭「#」と空白のみの行を削除して表示させる


本シリーズのトップページ
https://qiita.com/robozushi10/items/5d1313fa11ede179ddad

概要

行頭「#」と空白のみの行を削除して表示させる.

下記のどれかを実行すれば良い

$ sed -r -e '/^(\s*)$/d' -e '/^#/d' /etc/dnsmasq.conf
$ sed -e '/^[[:space:]]*$/d' -e '/^#/d' /etc/dnsmasq.conf
$ grep -E -v '^\s*$' /etc/dnsmasq.conf