Hide comments

nocomments () { cat $1 | egrep -v '^[[:space:]]*#|^[[:space:]]*$|^[[:space:]]*;' | sed '/<!--.*-->/d' | sed '/<!--/,/-->/d'; }
Hide comments and empty lines, included XML comments,
Sample Output
$ wc -l /etc/samba/smb.conf
288
$ nocomments /etc/samba/smb.conf
[global]
	workgroup = Babylon5
	server string = Samba
	log file = /var/log/samba/log.%m
	max log size = 50
	passdb backend = tdbsam
	cups options = raw
	username map = /etc/samba/smbusers
	guest ok = yes
	guest account = fernando
[homes]
	comment = Home Directories
	browseable = no
	writeable = yes
[printers]
	comment = All Printers
	path = /var/spool/samba
	browseable = no
	printable = yes

1
2011-11-04 12:47:39

What Others Think

Command linefu is a website that works as a software in computer or electric machines. You can also use them for statistical forums. Also you get grade miners reviews to solve your thesis work. Check their website for more learning sessions and information on it.
JosephHyett · 108 weeks and 4 days ago
These lines of code will perform the operation that includes hide comments and empty lines, including xml comments. I am expecting more such garage door opener repair comments over here that helps you to decrease your line of codes on performing various tasks. I am looking here for more details on that.
Alyssalauren · 38 weeks ago
I am happy to find your distinguished way of writing the post. Now you make it easy for me to understand and implement the concept. Thank you for the post. ASTM Level 3
jackson2321 · 23 weeks and 5 days ago
Your work here on this blog has been top notch from day 1. You've been continously providing amazing articles for us all to read and I just hope that you keep it going on in the future as well. Cheers! F95 Zone
jackson2321 · 23 weeks and 3 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. ??
jackson2321 · 23 weeks and 3 days ago
Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. dg casino
KayGasaway · 22 weeks and 6 days ago
Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. Pi Email
KayGasaway · 22 weeks and 4 days ago
a extremely superb webpage. a realy educational in addition to a an extremely superior position. i’m a sucker for the. http://www.wireonelogin.com
KayGasaway · 22 weeks ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. joker123
KayGasaway · 21 weeks and 1 day ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. dg368
KayGasaway · 21 weeks and 1 day ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. casino
KayGasaway · 21 weeks and 1 day ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. icasino
KayGasaway · 21 weeks and 1 day ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. slotxo
KayGasaway · 21 weeks and 1 day ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. ????????????
KayGasaway · 21 weeks and 1 day ago
A very excellent blog post. I am thankful for your blog post. I have found a lot of approaches after visiting your post. ????? foxz88
KayGasaway · 21 weeks and 1 day ago
Awesome things you've generally imparted to us. Simply continue written work this sort of posts. http://www.hifimodelescortsgurgaon.com/delhi.php http://www.hifimodelescortsgurgaon.com/callgirlsinbhiwadi.php http://www.hifimodelescortsgurgaon.com/manesar-escorts.php http://www.hifimodelescortsgurgaon.com/badshahpur-escorts.php http://www.hifimodelescortsgurgaon.com/hot-bangalore-escorts.php http://www.hifimodelescortsgurgaon.com/udaipur-escorts-agency.php http://www.hifimodelescortsgurgaon.com/ahmedabad-call-girls.php http://www.hifimodelescortsgurgaon.com/jaipur-call-girls.php http://www.hifimodelescortsgurgaon.com/imt-manesar-escorts.php http://www.hifimodelescortsgurgaon.com/hyderabad-escorts-service.php http://www.hifimodelescortsgurgaon.com/ardee-city-escorts.php http://www.hifimodelescortsgurgaon.com/mg-road-escorts.php http://www.hifimodelescortsgurgaon.com/hot-bristol-chowk-escorts.php http://www.hifimodelescortsgurgaon.com/gurgaon-dlf-city-call-girls.php http://www.hifimodelescortsgurgaon.com/gurgaon-35-star-hotels-escorts.php http://www.hifimodelescortsgurgaon.com/gurgaon-sectors.php http://www.hifimodelescortsgurgaon.com/hot-huda-city-centre-escorts.php http://www.hifimodelescortsgurgaon.com/russian-golf-course-escorts.php http://www.hifimodelescortsgurgaon.com/hifi-sohna-road-escorts.php http://www.hifimodelescortsgurgaon.com/vip-udyog-vihar-escorts.php http://www.hifimodelescortsgurgaon.com/hot-rajiv-chowk-escorts.php http://www.hifimodelescortsgurgaon.com/sexy-palam-vihar-escort.php http://www.hifimodelescortsgurgaon.com/iffco-chowk-escorts.php http://www.hifimodelescortsgurgaon.com/surajkund-escorts.php http://www.hifimodelescortsgurgaon.com/sikanderpur-escorts.php http://www.hifimodelescortsgurgaon.com/about-gurgaon-model-escorts.php http://www.hifimodelescortsgurgaon.com/photogalleryofgurgaonescorts.php
Sheebasaifi50 · 20 weeks and 5 days ago
This website helped me a lot while studying programming. I have my first project now withLincoln Towing!
MarkMatthews · 20 weeks and 4 days ago
I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. Innosilicon a10 pro
jackson2321 · 20 weeks and 3 days ago
Particular interviews furnish firsthand message on mart size, industry trends, ontogeny trends, capitalist landscape and outlook, etc. http://checkarticle2.unblog.fr/2021/09/06/good-quality-around-variety-precisely-why-us-online-casinos-are-generally-outstanding/">ufascr
jackson2321 · 18 weeks and 3 days 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.  http://checkarticle2.unblog.fr/2021/09/16/casino-titan-online-casino-look-at/">??????? ufabet
jackson2321 · 17 weeks and 1 day ago
Your post is very helpful to get some effective tips to reduce weight properly. You have shared various nice photos of the same. I would like to thank you for sharing these tips. Surely I will try this at home. Keep updating more simple tips like this.  http://www.hot-web-ads.com/view/item-14431760-Small-Business-Opportunities-8211-Start-a-Small-Business.html">visit our website
jackson2321 · 15 weeks ago
definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! vaobong
jackson2321 · 14 weeks and 5 days ago
Gambling website 789bet or 789betting is the best online gambling website and legal online casino service, providing online gambling services, online football betting, online slots, online lottery, online baccarat, online games, full range, full range, high return, link system to get wealth. pg 789 slot
KayGasaway · 12 weeks and 4 days ago
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post. Spare5 Review
seomind · 8 weeks and 3 days ago
The article posted was very informative and useful. You people are doing a great job. Keep going. Spare5 Review
seomind · 8 weeks and 3 days ago
Excellent effort to make this blog more wonderful and attractive. Spare5 Review
seomind · 8 weeks and 3 days ago
I’m excited to uncover this page. I need to to thank you for ones time for this particularly fantastic read!! I definitely really liked every part of it and i also have you saved to fav to look at new information in your site. Spare5 Review
seomind · 8 weeks and 3 days ago
Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people.. Spare5 Review
seomind · 8 weeks and 3 days ago
it was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity.. Spare5 Review
seomind · 8 weeks and 3 days ago
There is definately a great deal to know about this subject. I like all of the points you've made. Spare5 Review
seomind · 8 weeks and 3 days ago
I think about it is most required for making more on this get engaged Spare5 Review
seomind · 8 weeks and 3 days ago
very interesting post.this is my first time visit here.i found so many interesting stuff in your blog especially its discussion..thanks for the post! Spare5 Review
seomind · 8 weeks and 3 days 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: