Prints a file leaving out all blank lines and comment-only lines

egrep -v "^\s*(#|$)" myfile.cfg
Does not print any line that either: - is empty - contains only spaces or tabs - starts with # - starts with spaces/tabs followed by a #

2
By: dan
2011-12-08 15:25:17

What Others Think

You got your useless cat award. Congratulations
zolden · 640 weeks and 3 days ago
This, instead of dumping only lines containing only whitespace, will dump lines containing only "s". Probably not real useful, but you never know. :-)
trapperb · 640 weeks and 3 days ago
Might be useful for boring configs with lots of comments, but as pointed above it needs backslash before that s because, currently it does NOT do what description says.
mwgamera · 640 weeks ago
For some reason the backslash does not show up. Here's the command: cat boring.conf | egrep -v "^\s*(#|$)"
dan · 639 weeks and 6 days ago
Or: egrep -v "^\s*(#|$)" boring.conf No need for cat(1).
atoponce · 638 weeks and 6 days ago
Thanks @atoponce, much better. I've modified the command.
dan · 638 weeks and 4 days ago
Extremely helpful post. This is my first time i visit here. I discovered such a large number of intriguing stuff in your blog particularly its exchange. Truly its extraordinary article. Keep it up. N95 mask
jackson2321 · 136 weeks and 6 days ago
You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. ??
jackson2321 · 136 weeks and 3 days ago
Your source for the wholesale custom water purifier, air purifier, water hydrogen machine at a competitive price. Purificador de ar de Olansi
KayGasaway · 136 weeks and 3 days ago
Impressive web site, Distinguished feedback that I can tackle. Im moving forward and may apply to my current job as a pet sitter, which is very enjoyable, but I need to additional expand. Regards. Pi Email
KayGasaway · 135 weeks and 5 days ago
This is certainly hence attractive plus artistic. I like a colorations plus whichever company may get them while in the mailbox might be smiling. http://www.wireonelogin.com
KayGasaway · 135 weeks and 1 day ago
It's great that you have the urge to help students like me. Keep it up. Irvine Concrete Pros
OwenThatcher · 133 weeks and 5 days ago
Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us. Goldshell lt5 pro for sale
KayGasaway · 133 weeks and 4 days ago
Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing site de streaming
KayGasaway · 133 weeks and 1 day ago
Very efficiently written information. It will be beneficial to anybody who utilizes it, including me. Keep up the good work. For sure i will check out more posts. This site seems to get a good amount of visitors. ?????????????
KayGasaway · 132 weeks and 6 days ago
Your article is extremely helpful exceptionally fascinating subject i am looking that sort of post thank for imparting to us keep it up. ???????
KayGasaway · 132 weeks and 2 days ago
enamel badges made to order, Badge Creation make all types of badges and lapel pins, enamel and printed. Call us on 0845 299 6550 https://www.badgecreation.co.uk
KayGasaway · 130 weeks and 2 days ago
I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... ???????????
jackson2321 · 130 weeks and 1 day ago
This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: Autolikes
KayGasaway · 130 weeks ago
If you are looking for more information about flat rate locksmith Las Vegas check that right away. Hochschule Hamm Lippstadt
Joshua4524 · 129 weeks and 3 days ago
Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks https://okimdir.az/xeber/sahil-babayevin-ailesi/
hanry · 129 weeks and 1 day ago
I really like your blog. Great article. It's most evident, people should learn before they are able to http://www.filefactory.com/file/2rgg62nqv2yc/Benefits_associated%20with%20Vaping%20That%20you%20may%20Love.docx">thc wax
jackson2321 · 128 weeks and 6 days ago
You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. visit the site
jackson2321 · 128 weeks and 1 day ago
We are truly thankful for your blog entry. You will discover a great deal of methodologies in the wake of going to your post. I was precisely scanning for. A debt of gratitude is in order for such post and please keep it up.  Fun88
jackson2321 · 127 weeks and 6 days ago
First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks. thc dabs for sale
jackson2321 · 127 weeks and 5 days ago
This is my first time visit here. From the tons of comments on your articles,I guess I am not only one having all the enjoyment right here! "e?cinsel Filmleri izle":https://siyahfilmizle.net/filmizle/gay-film/
hanry · 127 weeks and 1 day ago
Thanks for your insight for your fantastic posting. I’m glad I have taken the time to see this. https://topuniversitieslist.com/yichun-university/
hanry · 126 weeks and 6 days ago
En nuestra web puedes encontrar pisos baratos donde entrar a vivir, te asesoraremos en todo lo que necesites. Terreno en venta en tenerife
hanry · 126 weeks and 5 days ago
Shanghai Pamaens Technology Co., Ltd specializes in the R&D, production and sales of energy-saving heating and insulation products, training and after-sale one-stop service. Infrared ceramic heater
hanry · 126 weeks and 4 days ago
Watchessy is a OEM & ODM watches manufacturer & supplier in China which can provide watches wholesale. We are your one-stop-shop solution to custom watch design,watch manufacturing and Watch necessaries(box,tag ,booklet,watch tool and so on). We also make private label watches based on customer's design or idea.Our designer will draw the engineering file and picture for you to check . And we can provide the necessary certificates like CE,Rohs which our customer require. We have our own factory,production and assembly with 10 years watch experience.Swiss Ronda,Japanese Miyota,Seiko movement is our watch movement supplier. Our warranty is at least one year. wholesale watches
hanry · 126 weeks and 4 days ago
Extremely pleasant article, I appreciated perusing your post, exceptionally decent share, I need to twit this to my adherents. Much appreciated!.  check that
jackson2321 · 126 weeks and 2 days ago
If you don"t mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries.  buy thc oil online
jackson2321 · 126 weeks and 1 day ago
Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! ????? mm88
jackson2321 · 125 weeks and 5 days ago
I think this is definitely an amazing project here. So much good will be coming from this project. The ideas and the work behind this will pay off so much. ?????
jackson2321 · 125 weeks and 4 days ago
I really like your blog. Great article. It's most evident, people should learn before they are able to ?????
jackson2321 · 125 weeks and 4 days ago
Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me. Canninghill Piers
jackson2321 · 125 weeks and 4 days ago
I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. chs fairmont
jackson2321 · 125 weeks and 4 days ago
I truly welcome this superb post that you have accommodated us. I guarantee this would be valuable for the vast majority of the general population. ??????
jackson2321 · 125 weeks and 2 days ago
A lot of people having an incorrect image about the cash advance loans or sometimes refer it as bad credit payday loans. ??????????????
jackson2321 · 125 weeks and 2 days ago
Incredible articles and awesome design. Your blog entry merits the greater part of the positive input it"s been getting. ???
jackson2321 · 125 weeks and 2 days ago
Nothing compares to Weber using Genesis sort of grills. That is certainly the type gas grills which have been that will always make sure that they deliver a high performance part of down interval here
jackson2321 · 125 weeks and 1 day ago
I want to say thanks for beautiful blog sharing with us. Your blog really great resource to update my knowledge. cat food flavor enhancers
jackson2321 · 125 weeks ago
Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing.  immobilien kaufen
jackson2321 · 125 weeks ago
Excellent .. Amazing .. I’ll bookmark your blog and take the feeds also…I’m happy to find so many useful info here in the post, we need work out more techniques in this regard, thanks for sharing.  youtube smm service
jackson2321 · 124 weeks and 4 days ago
I'm constantly searching on the internet for posts that will help me. Too much is clearly to learn about this. I believe you created good quality items in Functions also. Keep working, congrats! http://korsika.ning.com/profiles/blogs/strategies-for-purchasing-storage-space-containers-for-sale">shipping container for sale
jackson2321 · 124 weeks and 2 days ago
I needed to thank you for this incredible read!! I unquestionably adored each and every piece of it. I have you bookmarked your site to look at the new stuff you post. http://www.authorstream.com/dooseries76/">?????????
jackson2321 · 124 weeks and 2 days ago
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. http://www.maidoshop.com/anime-pillows/gotoubunnohanayome-c260">?????? ???
Joshua4524 · 124 weeks and 2 days ago
Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article... but I put things off too much and never seem to get started. Thanks though. http://www.maidoshop.com/anime-pillows/gotoubunnohanayome-c260
Joshua4524 · 124 weeks and 2 days ago
Extremely pleasant article, I appreciated perusing your post, exceptionally decent share, I need to twit this to my adherents. Much appreciated!.  Best Smm Panel
jackson2321 · 124 weeks ago
A debt of gratitude is in order for sharing the information, keep doing awesome... I truly delighted in investigating your site. great asset... Infinite Income Plan Review
seomind · 121 weeks and 4 days ago
Personally I think overjoyed I discovered the blogs. Infinite Income Plan Review
seomind · 121 weeks and 4 days ago
so happy to find good place to many here in the post, the writing is just great, thanks for the post. scamrisk
seomind · 121 weeks and 4 days ago
Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. scamrisk
seomind · 121 weeks and 4 days ago
I really enjoyed reading this post, big fan. Keep up the good work andplease tell me when can you publish more articles or where can I read more on the subject? Spare5 Review
seomind · 121 weeks and 4 days ago
I liked your article and I hope you will have many entries or more Spare5 Review
seomind · 121 weeks and 4 days ago
This is also a very good post which I really enjoy reading. It is not everyday that I have the possibility to see something like this. Spare5 Review
seomind · 121 weeks and 4 days ago
I've been looking for info on this topic for a while. I'm happy this one is so great. Keep up the excellent work Spare5 Review
seomind · 121 weeks and 4 days ago
Super site! I am Loving it!! Will return once more, Im taking your food likewise, Thanks. Spare5 Review
seomind · 121 weeks and 4 days ago
I adore your websites way of raising the awareness on your readers. Spare5 Review
seomind · 121 weeks and 4 days ago
If you set out to make me think today; mission accomplished! I really like your writing style and how you express your ideas. Thank you. cairns shipping containers
KayGasaway · 121 weeks and 1 day ago
With the plenty of social media destinations accessible, which ones are best for your business? Cheapest Bitcoin SMM panel for 2022
prostsmm · 110 weeks and 6 days ago
large thumbs up to the great information you could have here within this post. You created some decent points there. You seem to know so much about this topic recherche un film
padon3 · 104 weeks and 4 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
rahimhh21 · 81 weeks and 3 days ago
I should state just that its magnificent! The blog is instructive and dependably create astonishing things. ???????
merckseo · 76 weeks and 6 days ago
Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under $500 Near Me pug puppies for sale in texas pug puppies for sale $200 pugs for sale near me under $500 pugs for sale under $400 near me pugs for sale near me puppies for sale near me under $500 pug puppies for sale under $1,000 near me pug for sale pug puppies for sale under $300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under $500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies baby pug puppies for sale pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale $200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
Perfecthomepugs · 72 weeks and 1 day ago
grep is a command-line utility that searches for patterns in files. -v option is used to invert the matching, which means the lines that match the pattern will be excluded from the output. -e option is used to specify incredibox the pattern to match. '^\s*$' matches empty lines. ^ means the start of the line, \s* matches zero or more whitespace characters, and $ means the end of the line. '^\s*#' matches comment-only lines. ^ means the start of the line, \s* matches zero or more whitespace characters, and # matches the comment character. Replace the filename with the name of the file you want to print. This command will print all the lines in the file that are not blank or comment-only.
johndavidd88 · 53 weeks and 6 days ago
Pretty good article. I just stumbled across your blog and enjoyed reading your blog posts. I am looking for new articles to get more valuable information. Thanks a lot for the useful information tunnel rush
emmaorabelle · 44 weeks and 3 days ago
Perfect House Of Pugs acquired a passion for animals, and the Pug puppy in particular, at a young age since I grew up in a house with lots of dogs. It was a natural ability to know how to grow, nurture, and care for animals. I knew what the future held when I met my wife, who essentially had the same enthusiasm as I have. Being a breeder is more of a passion for me than a profession since I get to witness people's faces light up when they successfully adopt a pug puppy from our facility. It is not possible to find happiness in anything else. PLEASE VISIT OUR WEBSITE LINK BELLOW FOR MORE INFORMATION ABOUT PUG PUPPIES. PUG PUPPY ADOPTION Pug puppies for sale PUG PUPPIES FOR SALE NEAR ME PUG PUPPIES NEAR ME PUG PUPPIES FOR SALE UNDER 500 NEAR ME CUTE PUG PUPPIES BLACK PUG PUPPIES BLACK PUG PUPPIES FOR SALE PUG PUPPIES FOR ADOPTION BLACK PUG PUPPIES FOR SALE NEAR ME CHIHUAHUA PUG MIX PUPPIES TEACUP PUG PUPPIES HOW MUCH IS A PUG PUPPY BABY PUG PUPPIES PICTURES OF PUG PUPPIES PUG PUPPIES FOR SALE IN OHIO PUG PUPPIES FOR SALE IN PA PUG PUPPIES PRICE PUG MIX PUPPIES TEACUP PUG PUPPIES FOR SALE BABY PUG PUPPIES FOR SALE BEST FOOD FOR PUG PUPPY NEWBORN PUG PUPPIES PUG PUPPIES CRAIGSLIST PUG PUPPIES FOR SALE CRAIGSLIST WHITE PUG PUPPIES PUG PUPPIES FOR SALE IN MICHIGAN PUG PUPPIES FOR SALE UNDER 500 ADORABLE PUG PUPPIES BRINDLE PUG PUPPY HOW MUCH DOES A PUG PUPPY COST PITBULL PUG MIX PUPPIES PUGS FOR SALE NEAR ME PUG PUPPIES FOR SALE 200 PUG PUPPIES FOR SALE IN NJ PUG PUPPIES FOR SALE IN WISCONSIN PUG PUPPIES MICHIGAN PUG PUPPY COST MERLE PUG PUPPY FOR ADOPTION BEST PUG PUPPY FOOD ROYAL CANIN PUG PUPPY FOOD FAWN PUG PUPPY PUG PUPPIES FOR SALE FLORIDA PUG PUPPIES FOR SALE IN INDIANA PUG PUPPIES FOR SALE IN KY PUG PUPPIES FOR SALE IN NC PUG PUPPIES FOR SALE IN TEXAS PUG PUPPIES FOR SALE MN PUG DOG PUPPY AKC REGISTERED PUG PUPPIES FOR SALE PUG ALL BLACK CHEAP PUG PUPPIES FOR SALE NEAR ME PUGS PUPPIES FOR SALE CHEAP PUG PUPPIES FOR SALE IN CALIFORNIA MINIATURE PUG PUPPIES FOR SALE NEAR ME MINIATURE PUG PUPPIES FOR SALE CHEAP PUG PUPPIES FOR SALE IN NJ KNOWN FACTS ABOUT PUG PUPPIES ADOPT PUG PUPPIS RECUE A PUG PUPPY PERFECT HOUSE OF PUGS PUG PUPPIES INSTAGRAM PINTEREST QUORA Google Page USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA USA
pugpuppies95 · 34 weeks and 2 days ago
There is noticeably big money to comprehend this. I assume you have made certain nice points in features also. Gacha Life 2
HQservice · 22 weeks and 2 days ago
Thank you so much for the post you do. I like your post and all you share with us is up to date and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. Minecraft PE Apk
tecnggossip452 · 22 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: