Linux: Datei-Inhalt ohne Kommentare ausgeben

Wie kann ich eine Datei (z.B. eine Konfigurationsdatei) ohne Kommentare in der Console ausgeben:

cat /etc/squid3/squid.conf | egrep -v "^\s*(#|$)"

Beispiel:

root@debian:~# cat /etc/privoxy/config | egrep -v "^\s*(#|$)"
user-manual /usr/share/doc/privoxy/user-manual
confdir /etc/privoxy
logdir /var/log/privoxy
actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
actionsfile default.action   # Main actions file
actionsfile user.action      # User customizations
filterfile default.filter
filterfile user.filter      # User customizations
logfile logfile
listen-address  127.0.0.1:8118
toggle  1
enable-remote-toggle  0
enable-remote-http-toggle  0
enable-edit-actions 0
enforce-blocks 0
buffer-limit 4096
forwarded-connect-retries  0
accept-intercepted-requests 0
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 5
socket-timeout 300
forward-socks5 / 127.0.0.1:9050 .

Kommentar hinterlassen