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.

Universal configuration monitoring and system of record for IT.
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

Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

Indent all the files in a project using emacs

Terminal - Indent all the files in a project using emacs
find . -iname \*.c -or -iname \*.h -exec emacs -nw -q {} --eval "(progn (mark-whole-buffer) (indent-region (point-min) (point-max) nil) (save-buffer))" --kill \;
2010-09-10 05:07:11
User: zev
Functions: emacs find
0
Indent all the files in a project using emacs

Use find's exec and reduce the need for multiple evals with a progn wrapper.

Alternatives

There are 4 alternatives - vote for the best!

Terminal - Alternatives
find -iname \*.[ch] -exec emacs -nw -q {} --eval "(progn (mark-whole-buffer) (indent-region (point-min) (point-max) nil) (save-buffer))" --kill \;
2010-09-10 12:24:58
User: ioggstream
Functions: emacs find
3

use -iname \*[.ch] instead of -iname \*.c -o -iname \*.h

lst=`find . -iname \*.c -or -iname \*.h`; for i in $lst; do emacs -nw -q $i --eval "(mark-whole-buffer)" --eval "(indent-region (point-min) (point-max) nil)" --eval "(save-buffer)" --kill; done
2010-09-09 22:02:54
User: JollyJumper
Functions: emacs
0

indenting all the files at a time, if the file has local variable for indentation style its even better.

This one liner is not pretty but it does the job.

find . -iname \*.[ch] -exec indent "{}" \;
2010-09-10 13:25:10
User: putnamhill
Functions: find
-1

This version uses the indent C formatting utility. Doesn't appear to be included with ubuntu. But CentOS and MacOS have it.

Know a better way?

If you can do better, submit your command here.

What others think

chanyuan0712

http://www.michaelkorsoutletonline.in.net

http://www.chaussurelouboutin.fr

http://www.swarovskicrystals.com.co

http://www.edhardy.us.com

http://www.longchamp-handbags.com.co

http://www.mulberry-bags.co.uk

http://www.longchamppas-cher.fr

http://www.air-jordanshoes.us.com

http://www.cheap-raybansunglasses.us.com

http://www.timberlandboots.name

http://www.chicagoblackhawks.us.com

http://www.poloralph-lauren.us.com

http://www.outletmulberry.org.uk

http://www.oakleysun-glasseswholesale.us.com

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

http://www.clearancefitflopssale.com

http://www.hollistershirts.me.uk

http://www.oakley-sunglasses.me.uk

http://www.nikefreerun5.co.uk

http://www.louisvuitton--handbags.us.com

http://www.cheap-nikeshoes.cc

http://www.valentinooutlet.us.com

http://www.mbtshoesoutlet.us.com

http://www.burberryoutletstore.in.net

http://www.futbol-baratas.com

http://www.michaelkorsoutletclearancesale.us.com

http://www.michaelkorshandbagsoutletstore.us.com

http://www.cartieroutlet.us.com

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

http://www.michaelkors-outletclearance.us.com

http://www.polooutletstore.us.com

http://www.pumaoutletonline.com

http://www.reeboktrainers.org.uk

http://www.outlettruereligion.in.net

http://www.tommyhilfiger.org.uk

http://www.coachoutletonlinestore.com.co

http://www.burberryonlineoutlet.in.net

http://www.lebronjames.us.com

http://www.nike-mercurial.net

http://www.longchampoutlet.name

http://www.adidasoutletstore.in.net

http://www.nikeairmaxshoess.co.uk

http://www.tiffanyjewelryoutlet.us.com

http://www.coachoutletstoreclearance.us.com

http://www.pradashoes.us

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

http://www.michaelkorshandbag.in.net

http://www.abercrombiefitch-hollister.es

http://www.oakleysunglassesforsale.us.org

http://www.cheapoakleysunglassessale.us.com

http://www.nikeairmax90.me.uk

http://www.lululemonoutletonline.in.net

http://www.reebokoutletstore.us.com

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

http://www.ralphlaurenpolo.it

http://www.airjordan13s.com

http://www.jewelrytiffany.us.com

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

http://www.coachhandbagsclearance.us.com

http://www.coachoutletstore.com.co

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

http://www.cheap-jordanshoes.us.com

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

http://www.poloralph-laurenoutlet.us.com

http://www.longchampoutlet.us.com

http://www.pradaoutlet.us

http://www.truereligion.org.uk

http://www.coachoutletstores.com.co

http://www.louisvuitton-handbags.me.uk

http://www.babylissflatiron.us.com

http://www.marcjacobs.cc

http://www.cheap-nfljersey.us.com

http://www.niketrainers.me.uk

http://www.oakley-sunglasses.org.uk

http://www.gucci-outlet.us.org

http://www.louboutinpas-cher.fr

http://www.coachoutletonlineshopping.us.com

http://www.ralphlauren-pascher.fr

http://www.michaelkorsoutletonlinestores.us.com

http://www.pandora.eu.com

http://www.longchamphandbags.org.uk

http://www.burberrysaleoutlet.us.com

http://www.burberry-outletstore.in.net

http://www.longchamphandbags.org.uk

http://michaelkors.outletonlinestores.us.com

http://www.ghdstraighteners.org.uk

http://www.tomsshoes.in.net

http://www.fakeray-ban.net

http://www.katespadeuk.org.uk

http://www.nikefreerun5.co.uk

http://www.louisvuitton-handbags.org.uk

http://www.michaelkorswholesale.us.com

http://www.nikeoutletstore.us

http://www.hollisterclothingstore.in.net

http://www.ysloutletonline.com

http://www.michae-kors-outlet.ca

http://www.outletchristianlouboutin.us.com

http://www.montblancpenss.us.com

http://www.ferragamooutletstore.net

http://www.outlettoryburch.in.net

http://www.airmax90.us.com

http://www.nikerosherunwomen.co.uk

http://www.rolex-watches.it

http://www.michaelkorsclearance.in.net

http://www.diorsunglasses.com.co

http://www.nikeblazerpas-cher.fr

http://www.christianlouboutinonline.us.com

http://www.giuseppe-zanotti-outlet.org

http://www.nike-airmax2015.us

http://www.coachoutletonline-factory.us.com

http://www.nikestoreuk.org.uk

http://www.hermesoutletstore.us.com

http://www.coachoutletonlinesale.com.co

http://www.jeanstruereligion.in.net

http://www.ferragamoshoes.com.co

http://www.michaelkors-handbags.co.uk

http://www.cartierwatches.us.com

http://www.michaelkorsoutletcanada.in.net

http://www.toryburchhandbags.in.net

http://www.tomsshoes.me.uk

http://www.herveleger.us.com

http://www.calvinklein.in.net

http://www.tiffanyandco.me.uk

http://www.cheapmlbjerseys.us.com

http://www.rolexwatches.in.net

http://www.ralphlaurenpolo.us.com

http://www.abercrombie-fitch.us.com

http://www.lululemonoutlet.org.uk

http://www.ralphlaurenpas-cher.fr

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

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

http://www.poloralph-lauren.org.uk

http://www.toryburchshoes.in.net

http://www.michaelkorsuk-outlet.org.uk

http://www.nikeairmax90.org.uk

http://www.nikestoreuk.org.uk

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

http://www.louis-vuitton.us.com

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

http://www.celineoutletus.com

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

http://www.lacostepoloshirts.cc

http://www.pololacostepascher.fr

http://www.hermesbelts.us

http://www.tiffany-jewelry.com.co

http://www.michaelkorshandbags.in.net

http://www.fitflopsshoes.co.uk

http://www.fitflopssale.in.net

http://www.cartierwatches.org.uk

http://www.rolexwatches-uk.co.uk

http://www.mcmoutlet.us.com

http://www.rayban-sunglassessale.us.com

http://www.polooutletstore.us.com

http://www.pradasunglasses.us.com

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

http://www.truereligionjeanssale.in.net

http://www.kobeshoes.us

http://www.nikeairforce1.fr

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

http://www.juicycoutureoutlet.net

http://www.coachoutletclearancesale.us.com

http://www.louisvuittonhandbag.us

http://www.coachoutlet-onlinestore.com.co

http://www.christianlouboutinscheap.us

http://www.cazal.us.com

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

http://www.lululemonoutletonline.us.com

http://www.cheapoakleysunglasseswholesale.us.com

http://www.beats-headphones.in.net

http://www.bottega-venetaoutlet.net

http://www.ralphlaurenpolo.com.co

http://www.versacesunglasses.com.co

http://www.hermesbirkin.org

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

http://www.rayban--sunglasses.me.uk

http://www.jordanshoes.us.com

http://www.todsshoes.us.com

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

http://www.toryburchoutlet.in.net

http://www.foampositeshoe.net

http://www.asicsisrael.com

http://www.tory-burchoutletonline.in.net

http://www.louis-vuittonoutletstore.us.com

http://www.coachoutletonlineclearance.com.co

http://www.katespade.org.uk

http://www.rolexwatchesforsale.in.net

http://www.louis-vuittonpascher.fr

http://www.instylerionicstyler.com

http://www.fredperrypoloshirts.com

http://www.rolexoutlet.us.com

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

http://www.nikefree5.us

http://www.christianlouboutinscheap.us

http://www.nikeoutletstores.us

http://www.pandorajewelryoutlet.us.com

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

http://www.iphonecase.me.uk

http://www.toryburchoutlet-online.us.com

http://www.cartierwatches.org.uk

http://www.salomonshoes.us.com

http://www.cheapnfljerseys.org

http://www.fitflopssaleclearance.in.net

http://www.nikeairmax90.co.uk

http://www.truereligionjeansoutlets.us.com

http://www.fakeray-ban.net

http://www.fitflopsshoes.in.net

http://www.ferragamo.eu.com

http://www.longchamppliage.fr

http://www.airjordan4.org

http://www.cheapmichaelkorshandbag.in.net

http://www.hollisteruksale.co.uk

http://www.sac-louisvuittonpascher.fr

http://www.swarovski.in.net

http://www.maccosmetics.in.net

http://www.swarovskicrystal.us.com

http://www.ferragamoshoesoutlet.net

http://www.raybansunglassesoutletstore.us.com

http://www.raybansunglass.com.au

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

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

http://www.suprashoes.us.com

http://www.saclongchamp-pliage.fr

http://www.sunglassesrayban.org.uk

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

http://www.hollistercanada.com

http://www.louisvuittonhandbagsoutlet.co.uk

http://www.rolex-watches.it

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

http://www.louisvuittonsunglasses.us.com

http://www.truereligionjeans-canada.com

http://www.airmax90.org.uk

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

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

http://www.storecoachoutlet.us.com

http://www.airforce1.us.com

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

http://www.coachoutletclearanceonline.us.com

http://www.oakleysunglasseswholesale.us.org

http://www.swarovskicrystal.me.uk

http://www.louisvuittonhandbags.org.uk

http://www.ray-bansunglasseswholesale.us.com

http://www.hollisteruksale.co.uk

http://www.cheapmlbjerseys.net

http://www.cheapfootballshirt.org.uk

http://www.truereligionoutlet.org.uk

http://www.salvatore-ferragamo.in.net

http://mulberryoutlet.outlet-store.co.uk

http://www.tiffanyjewellery.org.uk

http://www.beatsheadphones.org.uk

http://www.mulberry-handbagsoutlet.org.uk

http://www.wholesale-nbajerseys.com

http://www.louis-vuittonpascher.fr

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

http://www.michaelkorsbags.org.uk

http://www.raybansun-glassess.us.com

http://www.converseshoes.us.com

http://www.outletlongchamp.in.net

http://www.coachoutletclearance.us.com

http://www.vans-shoes.cc

http://www.basketballshoes.us.com

http://www.fitflop.in.net

http://www.kobe9elite.us.com

http://www.jordan-pascher.fr

http://www.cheap-snapbacks.us.com

http://www.michaelkorsusa.us

http://www.nike-outletonline.com

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

http://www.hermesbags.co.uk

http://www.tiffanyjewellery-outlet.co.uk

http://www.raybansun-glasses.in.net

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

http://www.outletswarovski.co.uk

http://www.cheapreplicawatches.com.co

http://www.coachoutletonline-stores.us.com

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

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

http://www.coachoutletonlinesale.us

http://www.truereligionjeans.org.uk

http://www.louisvuitton-neverfull.us.com

http://www.omegawatches.me.uk

http://www.truereligion-sale.in.net

http://www.adidasukstore.org.uk

http://www.michaelkorswallet.net

http://www.coachoutletclearanceonline.com.co

http://www.nikefreerunning.org.uk

http://www.ferragamoshoes.org.uk

http://www.coachoutlethandbags.us.com

http://www.longchamp-solde.fr

http://www.niketnpas-cher.fr

http://www.adidasukstore.org.uk

http://www.michaelkorshandbagsoutlet.us.org

http://www.rolexwatchesforsale.me.uk

http://www.lebronjamesshoes.in.net

http://www.poloralph-laurenoutlet.us.com

http://www.swarovskicrystal.in.net

http://www.michaelkorsoutletclearance.us.com

http://www.newbalanceshoes.in.net

http://www.mulberryhandbagssale.co.uk

http://www.hollister-clothingstore.net

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

http://www.tiffanyoutletonline.us.com

http://www.adidas-wings.in.net

http://www.pradahandbags.org.uk

http://www.soccerjerseys.us.com

http://www.rolexwatchesoutlet.us.com

http://www.guccisunglasses.co.uk

http://www.nikeairmaxshoes.org.uk

http://www.chromeheartsoutlet.us

http://www.ralphlaurenoutlet.org.uk

http://www.michaelkorsoutletonlinestore.us.com

http://www.cheapsoccerjersey.net

http://www.chromeheartssunglasses.us

http://www.tiffanyoutlet.in.net

http://www.cartier.us.com

http://www.nikeairhuarache.org.uk

http://www.fitflopssale.us

http://www.ralphlaurenpoloshirts.org.uk

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

http://www.mulberry-handbags.co.uk

http://www.christianlouboutin-outlet.me.uk

http://www.mulberryhandbags.org.uk

http://www.beatsbydrdre.co.uk

http://www.coachoutletcanada.com.co

http://www.nike-airhuarache.co.uk

http://www.fitflopsoutletsale.com

http://www.fitflopssale.me.uk

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

http://www.michae-kors-outlet.ca

http://www.ralphlaurenpas-cher.fr

http://www.ralphlauren-polo.in.net

http://www.nikerosherunshoes.co.uk

http://www.linksoflondons.co.uk

http://www.hollisterclothing.co.uk

http://www.outletmichaelkors.org.uk

http://www.abercrombie-fitch-hollister.fr

http://www.truereligionjeanssale.com

http://www.mulberrysale.co.uk

http://www.tiffanyjewelryoutlet.us

http://www.tomsoutlet-stores.com

http://www.polo-ralphlauren.com.co

http://www.toms.us.com

http://www.michaelkorsfactoryoutlet.us.org

http://www.poloralphlaurenshirts.us.com

http://www.kobebryantshoes.in.net

http://www.mizunorunningshoes.us

http://www.outletmichaelkors.co.uk

http://www.adidastrainers.me.uk

http://www.truereligionjeansoutlet.co.uk

http://www.beatsbydrdre-headphones.us.com

http://www.handbagslongchamp.us.com

http://www.thomassabo.me.uk

http://www.coachoutletclearancesale.com.co

http://www.airjordan11.net

Comment by chanyuan 6 weeks and 3 days ago

Your point of view

You must be signed in to comment.