Replace lines in files with only spaces/tabs with simple empty line (within current directory - recursive)

find . -type f -regex '.*\.\(cpp\|h\)' -exec sed -i 's/^[[:blank:]]\+$//g' {} +

0
2020-09-15 09:07:08

What Others Think

Thanks for sharing this. It could be more informational and understanding for us if you can explain it in detail. Hostsailor I hope that you will send it to me in the next post and try to update with this.
zaiyamariya · 62 weeks and 5 days ago
Let's play with us. We can always have great time super smash flash 2
Walter88 · 62 weeks and 4 days ago
hggfgh google
KennethIWilliams · 59 weeks and 4 days ago
great content! will recommend this site to my friends
looneyhans · 57 weeks and 3 days ago
I don’t even know how I ended up right here, however I assumed this commands was great. More Commands
wendyparis19 · 57 weeks and 1 day ago
gad i found this site. really learned alot hair extensions boise
looneyhans · 56 weeks and 5 days ago
guitar lessons des moines I need to know more
yeoyeo · 54 weeks and 2 days ago
are there any recent updates? fencingspringfieldmo.com
looneyhans · 52 weeks and 6 days ago
very helpful! bathroomremodelgreenbay.com
Killersmile · 52 weeks and 2 days ago
Given the fact that everything is turning towards the digital world reading books on making web Comics can also help greatly For More Information.
Beauvais · 51 weeks and 6 days ago
awesome site thanks alot executive coach new orleans
looneyhans · 49 weeks and 5 days ago
wow never knew about this before, thanks for sharing! realtor
idasanka · 48 weeks and 3 days ago
I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. pool cleaning service
bojokey283 · 48 weeks and 1 day ago
love your ideas! couples counseling
idasanka · 48 weeks and 1 day ago
Admiring the time and effort you put into your blog and detailed information you offer!.. abonnenten24
bojokey283 · 47 weeks and 1 day ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. automação doméstica
bojokey283 · 47 weeks ago
This was a really great contest and hopefully I can attend the next one. It was alot of fun and I really enjoyed myself.. online marketing
bojokey283 · 47 weeks ago
telemedicine mobile app quickly and seamlessly integrated all changes into the extant architecture. Providing confident, experienced assistance and a forward-thinking approach, the team implemented upgrades that ensured the platform’s future stability and scalability.
DanielCorwen · 46 weeks and 4 days ago
hearing aids virginia beach Can you tell me a bit more, please?
yeoyeo · 46 weeks and 3 days ago
I will share this content so I can find it in the future days of my class. Thank you! the best cbd creams
aldenbaigan · 45 weeks and 3 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. removal companies hartlepool
bojokey283 · 45 weeks and 2 days ago
I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. alquiler carros santa marta
bojokey283 · 45 weeks and 2 days ago
Admiring the time and effort you put into your blog and detailed information you offer!.. tree surgeon in colchester
bojokey283 · 44 weeks and 6 days ago
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. Heimautomation
bojokey283 · 44 weeks and 5 days ago
I know your expertise on this. I must say we should have an online discussion on this. Writing only comments will close the discussion straight away! And will restrict the benefits from this information. coronavirus playa del carmen
bojokey283 · 44 weeks and 1 day ago
I really enjoyed reading your article. I found this as an informative and interesting post, so i think it is very useful and knowledgeable. I would like to thank you for the effort you have made in writing this friv article.
gulgowski · 43 weeks and 4 days ago
thanks for sharing this with us! love it!
sammm · 43 weeks and 2 days ago
Your work is very good and I appreciate you and hopping for some more informative posts. Thank you for sharing great information to us. best restaurants in cozumel near cruise port
bojokey283 · 43 weeks ago
I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well! covid playa del carmen
bojokey283 · 42 weeks ago
I really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well! covid playa del carmen
bojokey283 · 42 weeks ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future... rugalmas ügyvéd Debrecen
bojokey283 · 40 weeks and 5 days ago
I’ve been searching for some decent stuff on the subject and haven't had any luck up until this point, You just got a new biggest fan!.. otomatisasi rumah
bojokey283 · 39 weeks and 4 days ago
Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one. LBrands Aces
Richlandd · 38 weeks and 6 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. sikerdíjas pályázatírás debrecenieknek
bojokey283 · 38 weeks and 6 days ago
Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks travel cancun to tulum
xoheko1229 · 38 weeks and 5 days ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. cozumel beach bars
xoheko1229 · 38 weeks and 3 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine. traditional yucatan food
xoheko1229 · 38 weeks and 1 day ago
I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! best resort in tulum
xoheko1229 · 38 weeks ago
Thanks for every other informative site. The place else may just I get that kind of information written in such an ideal means? I have a venture that I’m just now operating on, and I have been on the look out for such information. restaurant in tulum
xoheko1229 · 37 weeks and 6 days ago
I am glad you take pride in what you write. This makes you stand way out from many other writers that push poorly written content. best hotel playa del carmen
xoheko1229 · 37 weeks and 3 days ago
I felt very happy while reading this site. This was really very informative site for me. I really liked it. This was really a cordial post. Thanks a lot!. holbox top restaurants
xoheko1229 · 37 weeks and 1 day ago
Replace only if the file name matches another string / has a specific extension / is of a Recursive, regular files in this and all subdirectories that allow regular expressions , so you can search also tabs ( \t ), new lines ( \n ),etc. Replace newline in result with spaces (so that the list of files can be fed to sed .PrepaidCardStatus
Pridgen281 · 36 weeks and 6 days ago
Select Regular Expression. Enter ^[ \t]*$\r?\n into find what, leave replace empty. This will match all lines starting with white space and ending with carriage return (in this case a windows crlf) Click the Find Next button to see for yourself how it matches only empty lines. mypennmedicine
Park4521 · 36 weeks and 4 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. treatnheal
xoheko1229 · 35 weeks and 6 days ago
Great write-up, I am a big believer in commenting on blogs to inform the blog writers know that they’ve added something worthwhile to the world wide web!.. bathroom vanity
bojokey283 · 34 weeks ago
I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business. coronavirus holbox
bojokey283 · 32 weeks and 6 days ago
I got sufficient information from your soul of heart.Thank you so much tellpizzahut
BathKoala · 32 weeks and 4 days ago
Very nice article, I enjoyed reading your post, very nice share, I want to twit this to my followers. Thanks!. taroko gorge tour
bojokey283 · 32 weeks and 3 days ago
Hmm!! This blog is really cool, I’m so lucky that I have reached here and got this awesome information. http://www.fokuszpalyazat.hu/">Fókuszpályázat
muneerahmed · 31 weeks and 4 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.. Stone Masonry
bojokey283 · 31 weeks ago
Thanks for this great information. I'm thinking in looking for this one to my module purposes. masonry lake mary
aldenbaigan · 30 weeks and 6 days ago
Glad I knew www.marriagecounselingpensacola.com
geebranz · 28 weeks and 4 days ago
Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one. aces etm
acesetmlogin · 27 weeks and 3 days ago
https://www.commandlinefu.com/commands/view/25013/find-non-ascii-and-utf-8-files-in-the-current-directory
kenwood · 25 weeks and 3 days ago
Very soft cloud-like mattresses can wreak havoc on bad backs. This is because there is very little support in a soft mattress. While hard mattresses might be better for a bad back, very hard mattresses can cause just as much trouble. It all boils down to what works best for each individual. semi truck mattress
kenwood · 25 weeks and 3 days ago
There a few fascinating points on time in this posting but I don’t determine if I see they all center to heart. There exists some validity but Let me take hold opinion until I investigate it further. Very good article , thanks therefore we want more! Put into FeedBurner also http://besttemplatetuning.com/2021/06/30/baccarat-casino-match-learning-the-fundamentals/">Baccarat Casino Match
robinjack · 21 weeks and 1 day ago
Hello I am so delighted I found your website, I really located you by mistake, while I was looking on google for something else, Anyways I am here now and could just like to say cheers for a tremendous post and a all round entertaining blog. Please do keep up the great work. http://www.strandusa.com/">continuous body temperature monitoring
robinjack · 12 weeks and 6 days ago
I have been reading out a few of your stories and it’s pretty nice stuff. I will make sure to bookmark your site used office furniture baltimore md
robinjack · 11 weeks ago
Everything you need to know about News is very much important to us. SilverTech Solutions Blog
jhon2345 · 5 weeks and 5 days ago
Perfectly indited subject material , thankyou for information . mississippi commercial insurance
robinjack · 2 weeks and 1 day ago
A debt of gratitude is in order for sharing the information, keep doing awesome... I truly delighted in investigating your site. great asset... Mary Kay Review
seomind · 1 week and 3 days ago
I adore your websites way of raising the awareness on your readers. Mary Kay Review
seomind12 · 1 week and 3 days ago
Mary Kay Review I'm happy to see the considerable subtle element here!.
seomind12 · 1 week and 3 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 Mary Kay Review
seomind12 · 1 week and 3 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. Mary Kay Review
seomind12 · 1 week and 3 days ago
Personally I think overjoyed I discovered the blogs. Mary Kay Review
seomind · 1 week and 3 days ago
so happy to find good place to many here in the post, the writing is just great, thanks for the post. Mary Kay Review
seomind · 1 week and 3 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. Mary Kay Review
seomind · 1 week and 3 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? Mary Kay Review
seomind · 1 week and 3 days ago
I haven’t checked in here for some time as I thought it was getting boring, but the last few posts are great quality so I guess I’ll add you back to my daily bloglist. You deserve it friend Total Sports Apparel
yousuf · 23 hours 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: