Exclude Comments Empty Lines

grep -v '^$\|^\s*\#' /path/filename

example:

$ grep -v '^$\|^\s*\#' /etc/chrony.conf 
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony