List only empty directories and delete safely (=ask for each)

find . -type d -empty -exec rm -i -R {} \;
Will delete empty directories and sub-directories (hideen too = whose names are starting with dot .). Used 'rm' command instead of 'rmdir' to give the possibility of asking for confirmation before deleting i.e. it is not wise do delete all empty directories in /etc folder. Replace dot in 'find .' with any for other starting directory instead of current. in 'rm -i -R' 'i' stands for ask before delete and 'R' for delete folder recursively or folder itself if it is empty

0
By: knoppix5
2020-03-29 13:12:21

What Others Think

The article is really nice and interesting. I have searched for this type of information and would love to read this information. I hope you will share more useful articles like that. Thanks for sharing! t rex game
starjackioaz · 69 weeks and 5 days ago
I can try this command because my system is too heavy so I want to delete empty directories and make my system fast just similar to melbourne couriers same day which is the fastest parcel delivery service who departure your products on the same day.
graigalley · 69 weeks and 2 days ago
This article is really relevant to what I was trying to find. Thank you for this. I also found some video tutorials at Write My Assignment | AssignmentsExperts.co.uk that was also helpful for me.
jasonexpert · 54 weeks and 6 days ago
This query is run every time I also use it for deleting files and I may check the logo design price in pakistan for getting the best designing for business.
kanemarry · 46 weeks and 3 days ago
great content! will recommend this site to my friends best breast augmentation tulsa
looneyhans · 40 weeks and 5 days ago
I concur with the last tips whereby we have to manhandle what is eminent and inclining. By doing in that limit you can continue making something which is new and in the present style https://www.taini.in/jaipur-escorts-service.html
sumanrajput · 36 weeks and 6 days ago
This post is cleared up in a to an awesome degree able way. The detail with which it is clarified is so skilled. I am perplexed by the manner by which you have cleared up things here. http://www.independentescortjaipur.in/ http://www.femalejaipurescort.in/ http://www.jaipurcallgirlsservice.in/ http://www.sweetasinha.com/ http://www.jaipur-escort-girls.com/
sumanrajput · 36 weeks and 6 days ago
Hello, Extremely mind blowing this essential settlement are to an extraordinary degree bewildering and exceptionally pleasing for my control much thanks and sorry for my underwriting to set up everything here. http://www.jaipurescortservice.org/ http://www.jaipurqueen.in/ http://www.jaipurescortservice.insss/ http://www.celebrityescortsinjaipur.com/ https://www.jaipurvipcallgirls.com/
sumanrajput · 36 weeks and 6 days ago
Good data, basic and amazing graph, as offer all around completed with splendid insights and musings, piles of incredible data and motivation, the two of which I require, due to offer such a consistent data here http://www.modelcallgirlsjaipur.com/ http://www.alicja.in/ http://www.jaipurmodelescorts.co.in/ http://www.jainakapoor.in/ http://www.escortinjaipur.net/
sumanrajput · 36 weeks and 6 days ago
nice seospokanecompany.com
looneyhans · 36 weeks and 1 day ago
nice very great post! amarilloweddingphotographers.com
Killersmile · 35 weeks and 5 days ago
this is awesome! thanks for sharing! laser hair removal
idasanka · 31 weeks and 3 days ago
cleaning services orlando This is great! Thanks so much!
yeoyeo · 29 weeks and 6 days ago
thank you for this! really appreciate you doing this pray
sammm · 26 weeks and 5 days ago
I have been a standard guest on your site for about a year. Up until this point, you all around shared quality and significant articles. Considering, investigating your articles got one of my redirection chips away at during my available time. http://www.jaipurescortagency.com/"> Call Girls in Jaipur
sumanrajput · 24 weeks and 4 days ago
[url=http://www.retika.in/]Escorts in Jaipur[/url]
sumanrajput · 24 weeks and 4 days ago
hi
anvithatc · 22 weeks and 1 day ago
hi, thanks for sharing good information . for more click on: 13377x
anvithatc · 22 weeks and 1 day 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 trip to isla mujeres
xoheko1229 · 22 weeks and 1 day 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.Thankstulum from cozumel
xoheko1229 · 22 weeks and 1 day ago
I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information? yucatan cuisine
xoheko1229 · 21 weeks and 3 days 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! luxury hotel in tulum
xoheko1229 · 21 weeks and 3 days ago
Hello I am so delighted I located your blog, I really located you by mistake, while I was watching on google for something else, Anyways I am here now and could just like to say thank for a tremendous post and a all round entertaining website. Please do keep up the great work. restaurant in tulum mexico
xoheko1229 · 21 weeks and 2 days ago
You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you.
xoheko1229 · 20 weeks and 6 days ago
You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. best places to stay in playa del carmen
xoheko1229 · 20 weeks and 6 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!. restaurant holbox beach
xoheko1229 · 20 weeks and 4 days ago
I am amazed by the way you have explained things in this article. This article is quite interesting and I am looking forward to reading more of your posts. Thanks for sharing this article with us. cabinets santa fe
aegyjingoo · 17 weeks and 5 days ago
Roulette, baccarat, Black jack and poker remain the most popular but you will find many other games Ivip9 and the best thing is that the betting process is pretty much the same as in a real casino. All the major credit cards are accepted and the whole machinery runs smoothly.
bebasik · 13 weeks and 5 days ago
I don't have to worry now! eyelash extensions cincinnati
geebranz · 11 weeks and 6 days ago
la collision repair
henrywang2531 · 5 weeks and 6 days ago
Awesome blog! Do you have any tips for aspiring writers? I’m hoping to start my own site soon but I’m a little lost on everything. Would you advise starting with a free platform like WordPress or go for a paid option? There are so many choices out there that I’m totally overwhelmed .. Any suggestions? Thanks! http://deutschland-news.org/2021/06/30/on-line-baccarat-activity/">On line Baccarat Activity
robinjack · 4 weeks and 3 days ago
[url=http://deutschland-news.org/2021/06/30/on-line-baccarat-activity/]On line Baccarat Activity[/url]
robinjack · 4 weeks and 3 days ago
pool service los angeles
goodboy · 4 weeks and 1 day ago
arborist west austin tx
henrywang2531 · 1 week and 5 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: