Anecdotes from a Linux Systems Administrator. /root

Home About Books Blog Portfolio Archive
24 May 2020

Exclude comments and empty lines from file

by Alpha01

Every so often theirs the need to view a configuration (usually a large one), and you want an easy way to exclude all comments and empty lines:

egrep -v '^(#|$)' your-config-file.cfg
Tags: [ bash ]