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

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Jeremy C. Reed
Date:  
To: plug-discuss
Subject: 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