no # comments, blank lines, white space. # can start in any column

alias noc="awk 'NF && ! /^[[:space:]]*#/'"
The shortest and most complete comment/blank line remover... Any line where the first non-whitespace character is # (ie, indented # comments), and all null and blank lines are removed. Use the alias as a filter: noc /etc/hosts or grep server /etc/hosts | noc Change to nawk depending awk versions.
Sample Output
TestFile:
# comment
    ## indented comment

# above is a blank line
Uncommented line
# 'nuther comment

$ noc TestFile
Uncommented line
$

1
2014-09-07 00:50:57

What Others Think

Command line is a website that is working on computer language etc. It includes the shorter and most complete words are working on bark lines, white space, etc. And also you need to write my essays online essay to complete quality task easily. You can also get more information from them. Join their website for more information.
AliWentworth · 76 weeks and 1 day ago
Your article is extremely helpful exceptionally fascinating subject i am looking that sort of post thank for imparting to us keep it up. face mask
jackson2321 · 12 weeks and 1 day ago
I genuinely believed you would probably have something useful to say. All I hear is a bunch of whining about something that you can fix if you were not too busy looking for attention. After all, I know it was my choice to read.. ???????
jackson2321 · 11 weeks and 5 days ago
I appreciate several from the Information which has been composed, and especially the remarks posted I will visit once more. ????
jackson2321 · 11 weeks and 5 days ago
In the pasted 10 years, Olansi focuses on research and development, design, production and sale of household air purification health and environmental protection equipment, water purifiers, rich water machine of hydrogen, humidifier and healthy beauty care products. Purificatore d'aria di Olansi
KayGasaway · 11 weeks and 3 days ago
It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait reading. I am impressed with your work and skill. Thanks. Pi Email
KayGasaway · 11 weeks ago
Fantastic submit, Many thanks regarding revealing This kind of information. Fantasticly composed write-up, only if almost all people supplied the identical amount of articles when you, the net would have been a greater spot. You should keep writing! http://www.wireonelogin.com
KayGasaway · 10 weeks and 3 days ago
Olansi Healthcare Co., Ltd is located in Guangzhou, China.Olansi Company is a professional air purifier OEM manufacturer, the products contain Chinese air purifier, home air purifier, Hepa air purifier, negative ion air purifier, ionizer air purifier, d 'air ionizer, PM2.5 air purifier, car air purifier, room air purifier, intelligent air purifier and so on. Purificatore d'aria di Olansi
KayGasaway · 10 weeks and 2 days ago
This is helpful for me since I am currently doing a project right now for Law Offices of Durham and Ng.
OwenThatcher · 9 weeks ago
Wonderful blog! Do you have any tips and hints for aspiring writers? Because I’m going to start my website soon, but I’m a little lost on everything. Many thanks! Cryptocurrency Mining
KayGasaway · 8 weeks and 6 days ago
SUPERSLOT888 We are an agent that provides services for applying, depositing, withdrawing, easy to break slots, fully automated systems. With admins waiting for service 24 hours a day, easy to use, just a few seconds can be used. SUPERSLOT
KayGasaway · 8 weeks and 5 days ago
Designed and developed by Philip Morris International using the revolutionary IQOS HeatControl Technology, the device and the HeatStick enable the smoker to enjoy real tobacco taste without the typical hassles such as smoke, ash, or even smell. IQOS online
KayGasaway · 8 weeks and 5 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. choices thc carts
KayGasaway · 8 weeks and 4 days ago
Just pure classic stuff from you here. I have never seen such a brilliantly written article in a long time. I am thankful to you that you produced this! eztv
KayGasaway · 8 weeks and 2 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. Best bitcoin gambling sites
KayGasaway · 7 weeks and 6 days ago
This is extremely fascinating substance! I have completely delighted in perusing your focuses and have reached the conclusion that you are right about a hefty portion of them. You are extraordinary. ???????
KayGasaway · 7 weeks and 4 days ago
I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. cours particuliers à domicile
KayGasaway · 7 weeks and 3 days ago
thanks for this usefull article, waiting for this article like this again. posao tražim
KayGasaway · 7 weeks and 3 days ago
You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!! ?????????123
KayGasaway · 7 weeks and 3 days ago
This particular is usually apparently essential and moreover outstanding truth along with for sure fair-minded and moreover admittedly useful My business is looking to find in advance designed for this specific useful stuffs… Autism
KayGasaway · 7 weeks and 3 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... https://www.ufadna.win/
jackson2321 · 6 weeks and 6 days ago
Extremely pleasant article, I appreciated perusing your post, exceptionally decent share, I need to twit this to my adherents. Much appreciated!. dekbedovertrekken
alvinhalstead · 6 weeks and 4 days ago
Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. congestive heart failure treatment
KayGasaway · 6 weeks and 4 days ago
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. Prediksi Sydney
KayGasaway · 6 weeks and 4 days ago
I want to say thanks for beautiful blog sharing with us. Your blog really great resource to update my knowledge. www.parasols-xl.nl">tuinparasol
alvinhalstead · 6 weeks and 4 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 www.koopeenairco.nl">beste mobiele airco
jackson2321 · 6 weeks and 4 days ago
New web site is looking good. Thanks for the great effort. Prediksi Sydney
KayGasaway · 6 weeks and 4 days ago
Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. dark web sites
KayGasaway · 6 weeks and 4 days ago
I know your aptitude on this. I should say we ought to have an online discourse on this. Composing just remarks will close the talk straight away! What's more, will confine the advantages from this data.  Notícias dos famosos
jackson2321 · 6 weeks and 4 days ago
Nice post mate, keep up the great work, just shared this with my friendz dark web links
KayGasaway · 6 weeks and 4 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. ???????
alvinhalstead · 6 weeks and 3 days ago
I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information. Resolvly LLC
alvinhalstead · 6 weeks and 3 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. Roulette Online
KayGasaway · 6 weeks and 2 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. Dadu Online
KayGasaway · 6 weeks and 2 days ago
All the contents you mentioned in post is too good and can be very useful. I will keep it in mind, thanks for sharing the information keep updating, looking forward for more posts.Thanks Slot88
KayGasaway · 6 weeks and 2 days ago
One present why galore businesses opt for postcards is because they are overmuch cheaper to be prefab and this can forbear a lot of expenses on the lengthened run. ??
alvinhalstead · 6 weeks and 2 days ago
Your post has those facts which are not accessible from anywhere else. It’s my humble request to u please keep writing such remarkable articles http://goz88.com/">????????????
jackson2321 · 6 weeks and 2 days ago
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. ????????????
jackson2321 · 6 weeks and 2 days ago
I have been checking out a few of your stories and i can state pretty good stuff. I will definitely bookmark your blog site
KayGasaway · 6 weeks and 2 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! contact voodoo priest
jackson2321 · 6 weeks and 2 days 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. ??????????????????
alvinhalstead · 6 weeks and 2 days ago
I wanted to thank you for this great read!! I definitely enjoying every little bit of it I have you bookmarked to check out new stuff you post. site
KayGasaway · 6 weeks and 1 day ago
You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant! ????????????
KayGasaway · 6 weeks and 1 day ago
No doubt this is an excellent post I got a lot of knowledge after reading good luck. Theme of blog is excellent there is almost everything to read, Brilliant post. ?????????
KayGasaway · 6 weeks and 1 day ago
Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting and has sets of fantastic information. Mobile Car Service Reading
KayGasaway · 6 weeks and 1 day ago
Thanks for the blog filled with so many information. Stopping by your blog helped me to get what I was looking for. Now my task has become as easy as ABC. F95 zone game
KayGasaway · 6 weeks and 1 day ago
I appreciate several from the Information which has been composed, and especially the remarks posted I will visit once more.  ?????????
KayGasaway · 6 weeks ago
Your post has those facts which are not accessible from anywhere else. It’s my humble request to u please keep writing such remarkable articles http://goz88.com/">?????
KayGasaway · 6 weeks 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 · 5 weeks and 4 days ago
I really like your blog. Great article. It's most evident, people should learn before they are able to ?????? ufabet
jackson2321 · 5 weeks and 3 days ago
Whenever I have some free time, I visit blogs to get some useful info. Today, I found your blog with the help of Google. Believe me; I found it one of the most informative blog. Mobile Tyres Berkshire
KayGasaway · 5 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.  spy my phone
jackson2321 · 5 weeks and 1 day ago
You guardians do an astounding web diary, and have some unfathomable substance. Continue doing extraordinary. spy app
jackson2321 · 5 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.  juan pablo carrasco de groote empresario
jackson2321 · 5 weeks ago
Your post has those facts which are not accessible from anywhere else. It’s my humble request to u please keep writing such remarkable articles funny quotes
millytexas · 4 weeks and 1 day ago
For a long time me & my friend were searching for informative blogs, but now I am on the right place guys, you have made a room in my heart! click here
jackson2321 · 3 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: