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

Go to the Nth line of file [text editor]

Terminal - Go to the Nth line of file [text editor]
vi +4 /etc/mtab
2011-09-15 19:18:00
User: totti
Functions: vi
1
Go to the Nth line of file [text editor]

This is not printing, real editing using the text editor.

Alternatives

There are 3 alternatives - vote for the best!

Terminal - Alternatives
sed -n 13p /etc/services
sed -n '15p' $file
2011-09-16 07:27:11
User: marek158
Functions: sed
Tags: goto
0

Prints exactly 15th line of $file. You can also specify a range:

sed -n '2,18p' $file - this will print lines 2 to 18, inclusive.

echo "13" | ed /etc/services
2011-09-15 19:37:49
User: muonIT
Functions: echo ed
Tags: goto
-5

Nth line of a file - dirty hack way. I haven't used ed in ages ;-)

head -n 13 /etc/services | tail -n 1
2011-09-15 19:39:49
User: muonIT
Functions: head tail
Tags: goto
-5

Silly approach, but easy to remember...

Know a better way?

If you can do better, submit your command here.

What others think

What's up with the down-vote sans comment?

+1 from me

sometimes I'll get a "syntax error on line 54", so I'll launch vi and then key in 53 and then the down arrow. This saves me one small step, (though not any keystrokes)

Comment by unixmonkey365 262 weeks and 3 days ago

scream, www.swarovski-crystal.us.com or www.babyliss-pro.us.com enjoy www.levisjeans.com.co the www.juicycoutureoutlet.net.co cicadas www.tomsoutlet-online.com flap www.swarovskijewelry.com.co its www.mk-outlet.us.com wings www.mcmhandbags.com.co when www.converse.net.co you www.burberrys-outlet.co.uk bring www.tommy-hilfiger-online-shop.de the www.michaeljordan.com.de cool wind; www.new-balance-schuhe.de when www.converse-shoes.net passing www.uggsoutlet.com.co Hasuike www.christianlouboutinshoes.jp.net also www.tocoachoutlet.com puffed breath www.tommy-hilfiger.com.de goods products that www.nike.org.es Lotus www.nike-air-max.ca aroma; www.guccishoes.com.co hours because ignorance www.tommy-hilfigeroutlet.com has www.tiffany-andco.com.au been www.hermes-outlet.com.co poked hornet's nest www.pumashoes.in.net and www.true-religion.com.co stung www.harrods-london.co.uk his www.coachblackfriday.com face www.outlet-burberry.net.co was www.chiflatiron.net.co bruised. www.bottegaveneta-bagsoutlet.com Dig www.toms-outlets.us.com once, www.louis-vuitton-taschen.com.de because www.coach-factory.in.net "small www.nikerosherun.us insects" www.raybans.us.org (Sparrow) www.louboutin.jp.net and www.rosherun.org.uk took www.yoga-pants.net.co out www.tommy-hilfiger.co.nl a www.timberlandshoes.net.co "snake" www.nikefree5.net (Snake) www.lauren-ralph.co.uk scared www.tomsoutletonline.net to www.guccihandbags.net.co fall www.burberryoutlet-sale.in.net from www.uggboots.net.co the www.ralphlaurenoutletonline.in.net wall. www.pandora-charms.org.uk Fortunately, www.tommyhilfigeroutlet.in.net nothing www.nike-air-max.com.de serious. www.guccioutlet-sale.in.net Leisure time, www.air-max.com.de will www.nike-rosherun.nl collect www.nikefree-run.org.uk some www.beatsbydrdre.co.com cigarette www.swarovski-online-shop.de paper www.coachoutletstore.net.co folded www.ugg-boots.ca triangle, www.ugg-uggboots.net and www.oakleys-sunglasses.us.com partners www.rosheruns.us to www.truereligion-outlet.us.org play; (the www.barbour-factory.com triangle www.nikestore.us on www.newoutletonlinemall.com the www.katespadeoutlet.gb.net ground www.toryburchoutlet-sale.us.com and put www.tiffany-andco.us.com his www.rolexwatchesforsale.us.com hand www.timberlands-paschere.fr on www.michael-kors.com.co the www.longchamp-handbagsoutlet.us.com ground www.ralphlaurenepolo.com quick www.converse-shoesoutlet.com photo www.christianlouboutinshoesoutlet.org shoot www.toms-shoes.net.co the www.michaelkors-uk.org.uk other www.burberry-handbagsoutlet.com.co side www.nike-air-force.de of www.northfaceoutlet.com.co the nike.shoesoutlet.us.com triangle www.thomas-sabo.com.de is www.ralphlaurenpolos.in.net the www.thejoreseproject.com triangle www.michael-kors-handbags.us.com that www.bcbg-max-azria.ca turned www.swarovski--uk.me.uk their www.supra-shoes.org a); www.ferragamoshoes.in.net and www.designerhandbagsoutlet.net.co also www.michaelkorsoutlet.ar.com than www.replicarolex-watches.us.com own www.rayban-sunglasses.us.org older www.rayban.org.es brother www.hollister-clothing.in.net and www.montres-pascher.fr sister www.montblanc--pens.in.net were www.oakley-outletstore.in.net led www.louis--vuitton.org.uk to www.longchamp.com.de a www.coach-outletonline.net.co wide www.fashionclothes.us.com flat www.converse.com.de on www.giuseppe-zanotti.net the www.burberry-outlet.net.co grass www.coach-factoryoutlet.net.co or www.louisvuitton-outlets.us doing www.asics-outlet.us.com "of www.adidas-superstar.nl chicken" www.michaelkors-outlet-online.com.co or www.pumaonline-shop.de "kill www.nike-shoes-canada.ca the www.cheapuggboots.us.com lamb" www.soccer-shoesoutlet.com of www.nike--freerun.co.uk the www.prada-shoes.com.co game, www.nike-airmaxinc.co.uk before www.abercrombie-fitchsale.com the www.bebeclothing.in.net election www.nikestore.com.de when www.coach-purseoutlet.net one www.longchamp.com.co eagle, www.instylers.us.com then www.toms--outlet.com.co tall www.lululemoncanada.ca in www.barbour-jacketsoutlet.com front when www.cheap-michaelkors.com hens www.basketballshoes.com.co , www.adidas-superstar.de when www.chanelhandbags.net.in the www.nikefree-run.net rest www.toryburch-sandals.in.net of the www.adidasshoes.top chicken, www.nike-roshe-run.de the www.pulseras-pandora.com.es eagle www.toms-shoes.com.co chasing www.burberryoutlet2016.us.com shot www.nike-air-max.com.se at www.louis-vuittonoutletcanada.ca the www.oakley-sunglasses.mex.com back www.uggboots.com.de of www.nike-air-max.us the www.raybans-sunglassesoutlet.in.net chick, www.poloralphlaurenoutlet.net.co hen www.longchamps.us.com with www.eyeglassframes.in.net open www.tiffanyand-co.net.co arms www.bcbg-dresses.com to www.reebok.com.de protect www.airmax-2015.org chickens, www.rolexwatches-canada.ca smart www.ralphlauren-polos.com.co dodge www.mkoutletonline.us.com to www.new-balance.ca keep www.michael-korshandbags.org.uk eagle www.ralph-laurenoutlet.ca patting. www.burberry-handbags2016.in.net Or a www.louisvuitton-outlet.com.co dozen www.pandorajewelry.top people sitting www.coachoutlet-online.com.co in www.replica-handbags.net.co a airhuarache.shoesoutlet.us.com circle, www.maccosmetics.net.co do www.coachhandbags2016.us.com a www.polooutlets-store.com do www.salomon-schuhe.com.de Diushou Juan www.nikeair--max.fr game: www.mcm-handbags.org the www.adidas-schuhe-online.de hands www.handbagsoutlet.net.co of www.vans-shoes.co.uk only www.michael-kors-canada-outlet.ca one www.michaelkorsoutlet-online.ar.com person www.hermesbags.jp.net to www.beats-by-dre.com.co take www.cheap-oakleyglasses.us.com the www.longchamphandbagsoutlet.net handkerchief www.newbalance-shoes.org out www.ralphslauren-outlet.co.uk of www.wedding--dresses.ca his www.mmoncler-outlet.com mouth www.nike-skor.com.se in www.tnf-jackets.us.com a www.the-northface.com.co circle www.air-huarache.co.uk singing www.scarpe-hoganoutlets.it Diushou www.ralphlaurenoutletonline.us.org Juan www.oakley-sunglasses-canada.ca songs, www.michael-kors-taschen.com.de danced www.tiffany-und-co.de around www.coco-chanels.us.com the www.gucci-shoes.net circle www.kate-spade.in.net turning www.eyeglassesonline.us.com quietly www.salvatoreferragamo.in.net throw www.asicsgels.de the www.burberrybags-outlet.com handkerchief www.hollister.us.org in the www.oakleys-glasses.us.com back www.christianlouboutin.org.uk of www.coach-factoryyoutletonline.net a www.michael-kors.net.co person. www.horloges-rolex.nl Then www.cheap-baseballbats.net run www.christian-louboutin-shoes.ca around www.michaelkors.so in www.swarovski-australia.com.au circles. www.juicycouture.com.co If www.cheap-raybans.com you www.tommyhilfiger.net.co have www.tomsshoes-outlet.us.com a www.ferragamo.com.co lap www.the-north-face.ca behind www.uggsaustralia.com.co the www.oakleysunglass-outlet.net handkerchief www.chanel-bags.com.co patting, www.toms-shoesoutlet.net this www.woolrich-clearance.com people www.nikeshoesoutlet.org.uk have www.ray--ban.ca not found www.cheap-jordans.net the www.jordanrelease-dates.us.com person www.guccishoes.in.net you www.nike-schoenen.co.nl want www.the-northfacejackets.us.com to www.adidas--canada.ca give www.michaelkors.co.nl a performance www.oakleyoutlet.ar.com for www.prada.com.de everyone; www.omegarelojes.es a www.michael-kors-australia.com.au joke, sing www.the-northface.net.co songs, or www.timberlandbootsoutlet.us.com back www.ghd-hairstraightener.net poem. www.longchampoutlet.com.co Then www.hermesbirkin-bag.net began www.canada-goosesjackets.us.com Diushou www.rolex-watches.us.com Juan www.pandorajewellery.com.au by www.truereligionjeans.net.co him www.chi-flatiron.us.com or www.nike-huarache.nl her. www.marcjacobs.us.com If www.ralphlauren-polos.co.uk this www.celine-bags.org is www.airhuarache.co.uk discovered immediately www.ghdhair-straighteners.co.uk took www.retro-jordans.com the www.gucci-outletstore.com handkerchief www.abercrombie-hollister.nl catch www.zxcoachoutlet.com Diushou Juan www.nike-tnrequinpascher.fr people, www.ralph-laurens.org.uk that www.jimmy-choos.com Diushou www.ralphlaurenoutlet-online.us.com Juan www.pradaoutlet.com.co will www.michaelkors.com.se continue www.soft-ballbats.com to www.adidas.org.es lose, www.ray-ban-outlet.us.com someone who www.weddingdressesuk.org.uk can www.ray-banocchiali.it back www.beatsbydre.com.co into www.pandora-charms-canada.ca place; www.uhren-shop.com.de catch, and airmax.misblackfriday.com throw www.rolex-watch.me.uk this www.cheapoakley-sunglasses.in.net man airmax.shoesoutlet.us.com who www.abercrombie-kids.us.com has www.nike-free-run.de sat www.beats-headphone.com.co on www.nfl-jersey.us.com the www.abercrombie-fitchs.us.com bit www.oakleysunglasses-cheap.in.net when this www.hogan.com.de man www.nikefactory.org will www.lululemon-australia.com.au be www.rayban-sunglassesoutlet.co.uk punished www.louisvuitton.so performances. We www.iphone-cases.net.co will www.pandora.com.de play www.ralphlaurenoutlet.us.com along www.abercrombie-and-fitch.us.com with www.hollisteronlineshop.com.de a www.calvin-kleins.us.com dozen www.ugg-bootsclearance.com "Stars www.oakley.org.es over www.ralph-lauren.com.au the www.tommy-hilfiger-canada.ca month www.guccishoes-uk.co.uk child" www.burberry-outletstore.net or www.louis-vuitton-australia.com.au "cat drilled www.louisvuitton.jp.net 72 www.jordanretro.org holes" www.burberryonlineshop.de game. www.christian-louboutinshoes.com.co (Read www.vans-shoes.net the www.rayban-wayfarer.in.net article www.michaelkorsbags.us.org Network: www.nike-schuhe.com.de www.sanwen.net)Also www.mizuno-running.net I www.newbalance-outlet.org remember www.edhardy.us.org one www.insanity-workout.us.com summer, supra.shoesoutlet.us.com that www.oakley--sunglasses.com.au the www.moncler-outlet.us.org acquisition www.pradahandbags.net.co of www.nike-shoesoutlet.us.com medicinal www.cheaprayban.com.co city www.airjordans.us recovered www.tory-burchshoesoutlet.net cicada www.truereligion-outlet.com.co skin www.lululemonoutlet.gb.net (medical www.tiffany-jewelry.net term www.nike-air-max.com.au called www.valentino-shoesoutlet.us.com cicada), www.thenorthface.com.de catty www.replica-watches.com.co two www.polos-ralphlauren.us.com five. So www.omega-watches.us.com every www.vans-schuhe.com.de day, together uggaustralia.misblackfriday.com with www.michael-kors-outlet-online.us.org my www.oakley.com.de brothers www.polo-outlets.com.co holding www.newbalance.com.es bamboo, www.hollister-abercrombie.com.se Dianzhe www.airmax-90.org plastic www.christian--louboutin.in.net bags, and www.designer-handbagsoutlet.us.com from www.jordan-shoes.com.co the www.ugg-boots-australia.com.au village www.cheapjerseys.com.co in www.louis-vuittonblackfriday.com the www.gucci-taschen-outlet.de woods to www.toryburchsale.com.co find www.louisvuittons.com.co a www.marc-jacobs.us.com tree www.nikeskos.dk cicada www.soccer-shoes.us.com skin, www.hollisters-canada.ca after www.burberry2016.co.uk the www.ralphs-lauren.co.uk end www.yoga-pants.ca of www.nikeair-max.es the www.ralphlaurenonlineshop.de summer, we www.abercrombieand-fitch.ca harvest www.nike-maxfr.com relatively www.cheapjerseys.us.org big, www.kate-spade.gb.net full www.cheapshoes.com.co harvest www.canadagooses-2016.com four www.ugg-boots.us.org pounds, www.bottega-veneta.us.com to www.ugg-australia.com.de buy www.cheapoakley-sunglasses.com ten www.christianlouboutinoutlet.net.co dollars. www.michaelkorsoutletonline-sale.us.com The www.uggs.in.net next www.michael-kors.com.es summer we www.polo-ralph-lauren.de look for www.p90xworkout.us.com a www.prada-handbags.com.co summer, more www.cheapmichaelkors.us.org than www.maccosmetics.gr.com the www.mcmsworldwide.com first www.mcm-bags.in.net year www.hollisterclothingstore.org looking www.ray-bansunglasses.net for even www.giuseppezanotti.com.co more, www.coachoutletstore-online.com.co I www.uggs.co.nl did www.coco-chanel.com.de not www.adidas.com.se expect www.rayban.com.de there www.burberry-outletonlinesale.in.net to www.michael-kors-outlet.us.org happily www.jimmy-chooshoes.com after www.oakleyoutlet-online.us.com being www.thenorthfacejackets.net.co told www.nikemercurial.in.net not www.longchamp-bags.us.com recovered. www.tiffanyandco-canada.ca Cicada www.burberrys-outlet2016.com got www.uggs-onsale.net hard www.burberryoutlet-canada.ca skin, www.nike-roshe-run.com.es back www.thomas-sabos.org.uk at www.rayban.co.nl home www.thenorth-faces.co.uk after www.mcmbags.net shuffling, www.cheap-nike-shoes.net and www.michael--kors.us.com

www.swarovskicanada.ca

Comment by zyf543 24 weeks and 1 day ago

http://www.christianlouboutin.in.net

http://www.airjordanretro.uk

http://www.oakleyglasses.com.co

http://www.mlbjerseysauthentic.in.net

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

http://www.ugg.name

http://www.mlbjerseyscheap.in.net

http://www.tiffanyand.co.uk

http://www.cheapralphlauren.in.net

http://www.michaelkorshandbagsoutlet.eu.com

http://www.huaracheshoes.uk

http://www.michaelkorsoutletstoreonline.com.co

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

http://www.fitflopsoutlet.in.net

http://www.jordansforcheap.us.com

http://www.cheapretro-jordans.com

http://www.zoomkb24.com

http://www.oakleysunglassescheap-sale.com

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

http://www.nfljerseyscheap.in.net

http://www.cheapbasketballshoes.us.com

http://www.coach-outlet.in.net

http://www.tomsoutletstore.us.com

http://www.jordanretro.uk

http://www.jewelrytiffanyand.co

http://www.cheapairjordan.us

http://www.cheapairjordan.in.net

http://www.chromehearts.in.net

http://www.adidasnmd.uk

http://www.kobebasketballshoes.net

http://www.minireplicahut.com

http://www.outletmichaelkorsinc.com

http://www.11jordanshoes.com

http://www.oakleysunglassesoutlet.us

http://www.uggoutlet.uk

http://www.michaeljordanshoes.us.com

http://www.cheapnfljerseysonlinestore.com

http://www.oakley-sunglassescheapsale.com

http://www.tomsoutletstore.name

http://www.adidasnmd.com.co

http://www.michaelkors-handbags.net

http://www.huarachesshoes.uk

http://www.raybansunglass.uk

http://www.discount-oakleysunglasses.us.com

http://www.michaelkorspurse.com.co

http://www.michaelkorsonline.net

http://www.michaelkorshandbagsclearance.com.co

http://www.airhuaraches.org.uk

http://www.michaeljordanshoes.net

http://www.michaelkorsoutletsfactory.us.com

http://www.mlbjerseyswholesale.in.net

http://www.oakleyvault.com.co

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

http://www.michaelkorshandbags.net

http://www.nfljerseyswholesale.in.net

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

http://www.oakleysunglassescheapssale.com

http://www.2016michaelkorsoutlet.us.com

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

http://www.outlettiffanyandco.us.com

http://www.outlettiffanyand.co

http://www.truereligiononsale.in.net

http://www.raybansunglass.us

http://www.oakleysunglasses-cheapsale.com

http://www.louis-vuittonhandbags.net

http://www.cheaptiffanyandco.in.net

http://www.oakley-sunglasses.co

http://www.airhuarache.uk

http://www.kobeshoes.uk

http://www.outletmichaelkors.com.co

http://www.fitflops.cc

http://www.jewellerytiffanyand.co

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

http://www.michaelkorsonline.name

http://www.cheaptruereligionjeans.us

http://www.fitflopssandals.net

http://www.cheapralphlaurenonline.uk

http://www.chromehearts.com.co

http://www.outletonlinemichaelkors.us.org

http://www.authenticjordanscheap.us.com

http://www.kobesneakers.com

http://www.huarachesshoes.co.uk

http://www.michaelkorsoutletonline.uk

http://www.nfljerseys2015.in.net

http://www.chinajerseyssaleonline.com

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

http://www.fitflops.com.co

http://www.raybansunglassesoutlet.org

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

http://www.cheapairjordan.uk

http://www.tiffany.net.co

http://www.zoomkb24.uk

http://www.raybanglasses.in.net

http://www.oakleystoreonline.us.org

http://www.cheapnfljerseysstorechina.com

http://www.michaelkorsoutlets-online.eu.com

http://www.tiffanyandcouk.uk

http://www.rayban-sunglasses.uk

http://www.michael-kors-handbags.com.co

http://www.tiffanyandcojewellery.us.com

http://www.fitflopsoutlet.uk

http://www.cheapauthenticjordans.us.com

http://www.oakleyoutlet-store.com

http://www.oakleysunglassescheapsales.com

http://www.airjordan.cc

http://www.christian-louboutin-outlet.uk

http://www.nikedunks.us.org

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

http://www.tiffanyandcooutletonline.us.com

http://www.cheaprealjordans.us.com

http://www.cheaprolexwatchesonline.in.net

http://www.nmdadidas.us.com

http://www.kobebasketballshoes.us.com

http://www.oakley-sunglass.in.net

http://www.oakleyssunglassescheapsale.com

http://www.cheap-jordanshoessale.com

http://www.michaelkorsoutletin.net

http://www.chromeheartsonline.us.com

Comment by sanjunn 17 weeks and 4 days ago

Your point of view

You must be signed in to comment.