Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.
Hide

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:

Hide

News

May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!
Hide

Top Tags

Hide

Functions

Remove annoying OS X DS_Store folders

Terminal - Remove annoying OS X DS_Store folders
find . -name .DS_Store -exec rm {} \;
2009-03-09 13:59:30
User: Svish
Functions: find rm
4
Remove annoying OS X DS_Store folders

Recursively removes all those hidden .DS_Store folders starting in current working directory.

Alternatives

There are 10 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

If you end it with \; then it runs rm separately for every file, which is unnecessary, so instead try

find . -name .DS_Store -exec rm {} +

That will make all the files as arguments to one rm command (or as many as your shell can handle) e.g. rm ./.DS_Store ./subfolder/.DS_Store ./path/to/.DS_Store ...

It's slightly easier on the system, and will run a bit faster for folders that have a lot of sub-folders with lots of .DS_Store files.

Comment by goodevilgenius 436 weeks and 6 days ago

In this case, the -delete action will work just fine.

find . -name .DS_Store -delete
Comment by DEinspanjer 436 weeks and 6 days ago

thanks for extra info. will try those out the next time I get a mac littered folder sent to me, hehe =)

Comment by Svish 436 weeks and 5 days ago

Before people go randomly deleting their .DS_store directories, it's worth knowing why the folder is there to begin with, and what its purpose it.

.DS_store directories are created every time you access a folder on your machine. It stores the position of icons, background image if any, and other attributes. Deleting this hidden directory means losing those customizations.

Also, next time you enter that folder, Mac OS X will recreate the .DS_store directory. So, you're just playing a cat and mouse game. Might as well learn how to use them appropriately rather than fight it.

Comment by atoponce 436 weeks and 4 days ago

Yeah, it seems like the use-case for this is if you've just transferred a directory tree to a non-OSX unix machine and want to clean it up. I can't see wanting to run this directly on my Mac, though.

Comment by woxidu 433 weeks and 6 days ago

Well, this was in fact for when I moved to a non-Mac. But I have also experienced that those files have become corrupt so I needed to delete them and let the os remake them. In my case it was actually the per-file meta file that was corrupted, but with a minor tweak this line helped me then too.

find . -name ._* -exec rm {} \;
Comment by Svish 380 weeks and 4 days ago

[url=http://www.nfljerseys.us/][b]NFL Jerseys[/b][/url]

[url=http://www.yeezyboost350.us.com/][b]Yeezy Boost 350 V2[/b][/url]

[url=http://www.longchampbags.us.com/][b]Longchamp Handbags[/b][/url]

[url=http://www.adidas-uk.org.uk/][b]Adidas UK[/b][/url]

[url=http://www.yeezys.org/][b]Yeezys[/b][/url]

[url=http://www.nike-stores.fr/][b]Nike Store[/b][/url]

[url=http://www.underarmouroutlet.us.com/][b]Under Armour Outlet[/b][/url]

[url=http://www.timberlanduk.org.uk/][b]Timberland Boots[/b][/url]

[url=http://www.jordan12.us/][b]Jordan 12[/b][/url]

[url=http://www.yeezy-shoes.us.com/][b]Yeezy Shoes[/b][/url]

[url=http://www.nikehuarache.us/][b]Nike Huarache[/b][/url]

[url=http://www.kedsshoesforwomen.com/][b]Keds Shoes For Women[/b][/url]

[url=http://www.yeezy.com.co/][b]Yeezy Shoes[/b][/url]

[url=http://www.nikeairmax.us/][b]Nike Air Max 2017[/b][/url]

[url=http://www.outlettoms.us/][b]Toms Outlet[/b][/url]

[url=http://www.ultraboostuncaged.us/][b]Ultra Boost[/b][/url]

[url=http://www.mlb-jerseys.us/][b]MLB Jerseys[/b][/url]

[url=http://www.adidas-nmds.com/][b]Adidas NMD[/b][/url]

[url=http://www.oakleyoutlet.net.co/][b]Oakley Outlet[/b][/url]

[url=http://www.rboutlet.org/][b]Ray Ban Outlet[/b][/url]

[url=http://www.katespadeoutlets.us/][b]Kate Spade Outlet[/b][/url]

[url=http://www.adidas-outlet.org/][b]Adidas Outlet[/b][/url]

[url=http://www.nikeairmax-90.com/][b]Nike Air Max 90[/b][/url]

[url=http://www.timberland-outlet.us/][b]Timberland Outlet[/b][/url]

[url=http://www.rayban-sunglasses.ca/][b]Ray-Ban Sunglasses[/b][/url]

[url=http://www.adidas-nmd.org.uk/][b]Adidas UK[/b][/url]

[url=http://www.adidaseqt.com/][b] Adidas EQT[/b][/url]

[url=http://www.ralphlaurens.org.uk/][b]Ralph Lauren UK[/b][/url]

[url=http://www.jordan4.us/][b]Jordan 4[/b][/url]

[url=http://www.cheapjordan-shoes.com/][b]Cheap Jordan[/b][/url]

[url=http://www.adidasnmdoutlet.com/][b]NMD Outlet[/b][/url]

Comment by lovelin1987 15 weeks and 4 days ago

http://www.michaelkors-handbags.in.net

http://www.canadagoosejacketssale.us.com

http://www.cheapraybans-sunglasses.us.com

http://www.michaelkorsoutletofficials.us.com

http://www.christian-louboutinoutlet.us.org

http://www.christianlouboutin.com.co

http://www.ralphlaurenpoloshirts.me.uk

http://www.lacosteoutlet.us.org

http://www.adidasshoes.us.org

http://www.coachfactoryoutletonlinestores.us.com

http://www.ralph-laurenpolooutlet.us.com

http://www.mont-blancpens.us.com

http://www.michaelkorsoutletclearancee.us.com

http://www.fitflopsaleclearance.us.com

http://www.polooutlet.name

http://www.coachfactoryoutletofficials.us.com

http://www.raybansunglassesformen.us.com

http://www.mbtshoesoutlets.us.com

http://www.oakley-sunglassesoutletonline.us.com

http://www.nikeshoes.com.co

http://www.cheapuggboots.name

http://www.cheapuggboots.org

http://www.raybansun-glasses.com.co

http://www.fredperry.org.uk

http://www.ralphlaurenpolo-uk.org.uk

http://www.valentinooutlet.in.net

http://www.polooutletralphlauren.us.com

http://www.oakleysunglasseswholesaler.us.com

http://www.montblancpensoutlet.com

http://www.ralphlauren-polo.me.uk

http://www.yeezyboost350-v2.us.com

http://www.mcmoutletonline.us

http://raybansunglasses.co-sunglasses.com

http://nikeshoes.nike-com.com

http://www.oakley-sunglassesclearance.us.com

http://www.truereligionjeanss.us.com

http://www.pandoraoutlets.us.com

http://www.montblancpens-outlet.us.com

http://www.lunetterayban.fr

http://www.airjordan4.us

http://www.canadagooseoutlet-store.com.co

http://www.adidasnmd-r1.us.com

http://www.truereligionjeans-sale.us.com

http://www.mlbjerseys.net

http://www.adidasyeezyshoes.name

http://www.poloralphlaurenfactorystore.us.com

http://www.cheapjordans.name

http://www.edhardyclothing.us.com

http://www.michaelkorsoutletclearancehandbags.us.com

http://www.polo-ralphlaurenuk.me.uk

http://www.fitflops-saleclearance.us

http://www.cheapmlb-jerseys.us

http://www.nikeshoesoutlet.us.com

http://polooutlet.amegov.com

http://www.katespadeshandbags.us

http://www.ralphlauren-outletuk.org.uk

http://www.canadagoose.name

http://www.ralph-laurenoutletuk.me.uk

http://www.ralphlaurenoutlets.org.uk

http://www.michaelkorsoutlet-online.in.net

http://www.fredperrypoloshirts.co.uk

http://www.kate-spadeoutlet.us.org

http://www.nike-shoes.us.com

http://www.truereligion-outletstore.us.com

http://www.polo-ralphlauren-pascher.fr

http://www.poloralphlauren-uk.me.uk

http://www.mbtshoescheap.us.com

http://www.pradaoutletstore.us

http://www.pradaoutlet-store.us.com

http://poloralphlauren.amegov.com

http://www.true-religionoutletstore.us.com

http://www.lebron-jamesshoes.us.com

http://www.cheapuggs.name

http://www.michaelkorsoutlet-clearance.org

http://www.oakleysunglasseswholesales.us.com

http://www.michaelkorsoutlet-clearances.us.com

http://adidasyeezyshoes.adidassale.net

http://www.pandorajewelry-outlet.us.com

http://www.katespadeoutlet-store.us.com

http://www.longchampoutlet.us.org

http://www.nikeoutlet.com.co

http://www.oakleysunglasseswholesalee.us.com

http://www.oakleysunglassescheaps.us.com

http://www.fredperryoutlet.us.com

http://www.longchampoutletofficial.us.com

http://www.coachfactory-outlet.eu.com

http://www.adidasoutlet.com.co

http://www.asicsrunningshoes.us.com

http://www.coach-outletonlineclearance.us.com

http://www.christianlouboutin-uk.org.uk

http://www.oakleysunglassesformen.us.com

http://www.nhljerseyss.us.com

http://cheapraybansunglasses.co-sunglasses.com

http://www.coachfactoryoutletmiami.us.com

http://www.coachoutletcoachoutletstore.us.com

http://www.adidasoutlet.us.org

http://www.cheapjordansfor-sale.us.com

http://www.michaelkorsoutletofficial.com

http://www.hermesbeltsoutlet.us.com

http://www.pandoraoutletstore.us.com

http://www.michaelkorsoutlet-clearance.us

http://www.ralphlauren-shirts.org.uk

http://www.ralphlaurenoutletonlinestore.us.com

http://www.ralphlaurenofficial.us.com

http://www.michael-korshandbags.in.net

http://www.michaelkorsoutletonlinestore.us.org

http://www.oakleysunglassesfactory.us.com

http://www.polooutlet.us.org

http://www.raybanssun-glasses.com.co

http://www.coachoutletonlinecoachfactoryoutlets.us.com

http://www.michaelkorssoutletclearance.us.com

http://www.poloralphlauren-uk.org.uk

http://nikeshoes.up-nike.com

http://www.poloralph-laurenuk.co.uk

http://www.michael-korsoutletstore.in.net

http://www.coachfactoryoutlet-coachoutlet.us.com

http://www.canadagoosejacketss.com.co

http://www.christian-louboutinshoes.us

http://www.coach-outletonlinecoachfactoryoutlet.us.com

http://www.cheapnfljerseys.eu.com

http://www.mlbjerseys-wholesale.us.com

http://www.adidasyeezy-shoes.us.com

http://www.nike-shoes.us.org

http://www.valentino-outlet.us.com

http://www.ralph-laurenpolo.us.org

http://www.raybansunglassesonsale90off.us.com

http://www.fitflopssaleclearance.name

http://www.coachoutletcoachfactoryoutlets.us.com

http://www.airjordan.us.org

http://www.canadagoose-outlets.com.co

http://raybansunglassesoutlet.co-sunglasses.com

http://www.uggoutlet.name

http://www.oakleysunglassesss.us.com

http://www.canadagooses.com.co

http://www.ralphlaurenshirts.me.uk

http://www.michaelkorsoutlet-clearance.com

http://www.cheapjordans-forsale.us.com

http://www.oakleysunglasseswholesaleonline.us.com

http://www.coachoutletonlinecoachfactoryoutlet.com.co

http://www.kate-spadeoutletstore.us.com

http://www.nbajerseyss.us.com

http://yeezyboost.adidassale.net

http://www.nikeoutletstorelocations.com

http://www.montblancpenss.com.co

http://www.pandorajewelrycharms.us.com

http://www.mulberryhandbagsuk.co.uk

http://www.hermesbirkins.us.com

http://www.coachoutlet-clearance.us.org

chenlili20170503

Comment by chenyingying 11 weeks and 4 days ago

Your point of view

You must be signed in to comment.