Re: way to cat a file with all lines except commented ones

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: Jeremy C. Reed
Dato:  
Til: plug-discuss
Emne: Re: way to cat a file with all lines except commented ones
On Wed, 19 May 2004 wrote:

> How can I cat a file and recieve all lines excpet ones commented out?


Use grep (or sed or awk) to filter out the lines you do not want.

For example:

grep -v ^# /etc/inetd.conf

(cat is not needed.)

For inetd.conf, I usually do want to get rid of blank lines too:

egrep -v '^$|^#' /etc/inetd.conf

Jeremy C. Reed

                 BSD News, BSD tutorials, BSD links
                http://www.bsdnewsletter.com/


---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss