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

Download Youtube video with wget!

Terminal - Download Youtube video with wget!
wget http://www.youtube.com/watch?v=dQw4w9WgXcQ -qO- | sed -n "/fmt_url_map/{s/[\'\"\|]/\n/g;p}" | sed -n '/^fmt_url_map/,/videoplayback/p' | sed -e :a -e '$q;N;5,$D;ba' | tr -d '\n' | sed -e 's/\(.*\),\(.\)\{1,3\}/\1/' | wget -i - -O surprise.flv
2011-01-25 04:19:06
User: Eno
Functions: sed tr wget
35
Download Youtube video with wget!

Nothing special required, just wget, sed & tr!

Alternatives

There are 2 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

oops! it's not working for me. I'm getting this error:

sed: 1: "/fmt_url_map/{s/[\'"\|] ...": extra characters at the end of p command

No URLs found in -.

Comment by kaartz 311 weeks and 6 days ago

I'm having the same problem with kaartz... I'm running OS X with the wget being ported to OS X.

Comment by TCorbin 311 weeks ago

Weird, it's working fine on GNU/Linux, I'll check that tomorrow on OSX ;)

Comment by Eno 311 weeks ago

the command works fine for me on Cygwin. for OS X, the sed implementation does support replacing with "\n" and hence the error. i tinkered with the command a bit and made it work on OS X using awk instead.

wget "http://www.youtube.com/watch?v=dQw4w9WgXcQ" -qO- | awk '/fmt_url_map/{gsub(/[\|\"]/,"\n");print}' | sed -n "/^fmt_url_map/,/videoplayback/p" | sed -e :a -e '$q;N;2,$D;ba' | tr -d '\n' | sed -e "s/\(.*\),\(.\)\{1,3\}/\1/;s/\\\//g" | wget -i - -O surprise.flv
Comment by ixseven 310 weeks and 3 days ago

Hi, With Firefox plugin, DownloadHelper you can get the real URL. So when you have the real link you can do :

screen wget -O fileName.flv "http://v21.lscache7.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Calgorithm%2Cburst%2Cfactor%2Coc%3AU0dYTVZST19FSkNNOF9OTFND&fexp=901316&algorithm=throttle-factor&itag=34&ipbits=0&burst=40&sver=3&signature=72BE5F2A3EDB50B05354CA542AE807B50C9F2CE1.87EA6771ABAB2B13E867C17E7F8894F77209DD68&expire=1298671200&key=yt1&ip=0.0.0.0&factor=1.25&id=5415eea9d2ca1a35"
Comment by ilanehazout 307 weeks and 5 days ago

Now it's not working since unicode symbol substitution. to get it work you should add "sed 's/\\u0026/\&/g' " at first. So that the result command is:

wget http://www.youtube.com/watch?v=dQw4w9WgXcQ -qO- | sed 's/\\u0026/\&/g' | sed -n "/fmt_url_map/{s/[\'\"\|]/\n/g;p}" | sed -n '/^fmt_url_map/,/videoplayback/p' | sed -e :a -e '$q;N;5,$D;ba' | tr -d '\n' | sed -e 's/\(.*\),\(.\)\{1,3\}/\1/' | wget -i - -O surprise.flv
Comment by aikikode 303 weeks and 6 days ago

Hi all

I have tried all the command to DL a youtube vid from a playlist

Here come what work for me:

mplayer -dumpstream -dumpfile "$i.flv" $(curl -s "

Just made a loop to take all the vid from a playlist but the only problem is the time that it take because it really read the vid and put it in a file :x

Hope it will work for you guys

Comment by BlckG33k 292 weeks and 4 days ago

I tried it in RHEL 6 and got the error.

Check this.

[[email protected] ~]$ wget http://www.youtube.com/watch?v=Ss_MZMJ28_Y -qO- | sed -n "/fmt_url_map/{s/[\'\"\|]/\n/g;p}" | sed -n '/^fmt_url_map/,/videoplayback/p' | sed -e :a -e '$q;N;5,$D;ba' | tr -d '\n' | sed -e 's/\(.*\),\(.\)\{1,3\}/\1/' | wget -i - -O surprise.flv

--2011-07-19 10:54:25-- http://o-o.preferred.nrt04s02.v12.lscache7.c.youtube.com/videoplayback?sparams=id%2Cexpire%2Cip%2Cipbits%2Citag%2Cratebypass

Resolving o-o.preferred.nrt04s02.v12.lscache7.c.youtube.com... 74.125.171.172, 2404:6800:4004:3::c

Connecting to o-o.preferred.nrt04s02.v12.lscache7.c.youtube.com|74.125.171.172|:80... connected.

HTTP request sent, awaiting response... 400 Bad Request

2011-07-19 10:54:25 ERROR 400: Bad Request.

Comment by ChankeyPathak 287 weeks and 1 day ago

cool

Comment by ZhaoZijie 219 weeks and 1 day ago

No working :

No URLs found in -.

:'(

i'm looking for this since 1 years :'(

Comment by kaldoran 174 weeks and 1 day ago

2016-1-26 xiaozhengm

http://www.coachfactory--outletonline.com

http://www.fitflopuk.me.uk

http://www.michaelkorsukbag.co.uk

http://www.get-coachoutletonline.org

http://www.michaelkors-handbag.me.uk

http://www.runningshoes.com.co

http://www.toms-outlet.cc

http://www.ugg-boots-store.com

http://www.louboutinshoes.cc

http://canadagoose.outletmalls.us.com

http://www.nike-blazerlow.fr

http://uggs.uggaustralia.qc.com

http://www.nikestoreuk.me.uk

http://www.true-religionjeans.net.co

http://coach.outletmalls.us.com

http://www.adidasshoes.name

http://michaelkors.adsmall.us.com

http://www.hermesbelt.in.net

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

http://coach.eshopping.us.com

http://louisvuitton.outletmalls.us.com

http://www.hermesuk.org.uk

http://www.katespadeoutletsale.in.net

http://toms.adsmall.us.com

http://www.fitflopssaleclearance.com

http://michaelkors.eshopping.us.com

http://ugg.adsmall.us.com

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

http://www.canadagoosejackets.org.uk

http://ugg.eshopping.us.com

http://www.timberlanduk.me.uk

http://www.jordan13.org

http://christianlouboutin.outletmalls.us.com

http://www.coachoutlet-storeonline.in.net

http://www.instylermax.in.net

http://www.coachfactoryoutletus.in.net

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

http://tiffany.outletmalls.us.com

http://www.louboutin.org.uk

http://www.monclerjacketsoutlet.us.com

http://louboutin.adsmall.us.com

http://www.louisvuitton-borse.it

http://www.mcmhandbags.name

http://www.truereligion-outlet.com

http://www.new-balanceoutlet.us

http://www.louisvuitton-sac-pascher.fr

http://www.outlet-toms.cc

http://canadagoose.shopgioia.com

http://www.coach-factory-outlet-online.us.com

http://www.top-coachoutletstore.org

http://www.edhardy-outlet.name

http://www.jordan6.net

http://www.longchamphandbags.com.co

http://www.chaussurelouboutin-pascher.fr

http://www.ghdstraighteners.me.uk

http://www.nike-tn-pascher.fr

http://www.saclongchamp-solde.fr

http://www.coachcanadaoutlet.ca

http://burberryoutlet.outletmalls.us.com

http://sunglasses.outletmalls.us.com

http://www.michael--korsoutlet.us.com

http://www.nikefreeruns.uk

http://michaelkors.outletmalls.us.com

http://www.mk-michaelkorsoutletonline.com

http://www.cheaplouisvuittonhandbags.org

http://burberry.eshopping.us.com

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

http://www.airjordan-pascher.fr

http://www.ralphlaurenuk.me.uk

http://www.moncler-jackets.org

http://www.adidassuperstar.co.uk

http://abercrombie.shopgioia.com

http://www.authenticlouisvuittonhandbags.net

http://www.airforce1-nike.fr

http://www.coach-factoryoutlet.cc

http://www.coachoutletonlinespick.org

http://www.coachouletbtf.com

http://rayban.eshopping.us.com

http://www.ghdhairstraighteners.com.co

http://www.ralph-lauren-pas-cher.fr

http://ralphlauren.shopgioia.com

http://rayban.adsmall.us.com

http://www.mcmoutlet.us

http://www.louisvuittonuk.me.uk

http://www.jordan-femmepascher.fr

http://www.toms.in.net

http://burberry.outletmalls.us.com

http://www.cheap-uggsonsale.in.net

http://oakley.adsmall.us.com

http://www.basketballshoes.net.co

http://ugg.shopgioia.com

http://www.raybansoutlet.in.net

http://www.mizunorunningshoes.in.net

http://www.pandoracharms.com.co

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

http://www.michaelkorsoutletoff.in.net

http://www.tomswedges.in.net

http://ugg.outletmalls.us.com

http://www.cheapjordansshoes.in.net

http://www.mymichaelkorssoutlets.org

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

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

http://www.nikeblazers.me.uk

http://burberry.shopgioia.com

http://timberland.adsmall.us.com

http://coach.adsmall.us.com

http://www.nike-airmax90.me.uk

http://www.nikesb.uk

http://www.nikerosherunwomen.me.uk

http://www.christianlouboutinuk.me.uk

http://www.ugg-boots-australia.com

http://www.adidas-trainers.me.uk

http://www.michaelkors-discount.com

http://www.polooutlet.us.com

http://www.niketrainers.com.co

http://www.airmax95.org.uk

http://www.montblancpens.us.org

http://www.adidasuk.org.uk

http://www.poloralphlauren.net.co

http://www.rolex-replicawatches.com.co

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

http://www.jordan3.net

http://www.cheapwholesaleuggboots.com

http://hollister.shopgioia.com

http://www.michaelkorshandbags.cc

http://www.fitflops.in.net

http://www.snapbacks-wholesale.us

http://www.edhardyukclothing.me.uk

http://www.michaelkors-outlet-handbags.com

http://www.fitflops.us

http://www.raybans.org.uk

http://northface.outletmalls.us.com

http://nike.outletmalls.us.com

http://www.michaelkorsoutletforus.com

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

http://www.juicy-couture.us

http://www.raybansunglassesdeals.com.co

http://www.louis-vuittonhandbags.us

http://www.quality-outlet.com

http://christianlouboutin.eshopping.us.com

http://www.cheap-tomsoutlet.us

http://www.longchampoutlet.net.co

http://www.michaelkors-bags.me.uk

http://www.louisvuittonoutlets.name

http://www.coach-factoryoutlet.eu.com

http://www.tomsshoes.us.com

http://www.canadagooseoutlet.cc

http://canadagoose.adsmall.us.com

http://www.adidasgazelle.me.uk

http://christianlouboutin.shopgioia.com

http://www.kate-spadeoutlet.com.co

http://www.pradaoutlet.name

http://www.guccioutlet.com.so

http://www.jordan4.net

http://canadagoose.eshopping.us.com

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

http://www.soccer-jerseys.us.com

http://www.nikerosheruns.me.uk

http://www.truereligion-outlet.net.co

http://oakley.shopgioia.com

http://www.sunglass-outlet.us

http://www.chiflatiron.in.net

http://www.tomsoutletstore.in.net

http://www.coachoutletstoreonlines.us

http://www.gucci-borse.it

http://www.jordan8.net

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

http://www.chaussure-louboutin.fr

http://www.michaelkors-outletsale.com

http://www.michael-korsuk.me.uk

http://www.nike-airmax.org.uk

http://burberry.adsmall.us.com

http://www.montblanc-pens.name

http://www.sac-longchamppliage.fr

http://www.saclongchamp--pascher.fr

http://www.michaelkorsoutletvip.in.net

http://www.cheapjordans.com.co

http://www.louisvuitton-outletstores.org

http://www.marc-jacobs.in.net

http://www.pandorajewelryoutlet.name

http://www.christianlouboutinsell.net

http://www.michael-kors-handbags.uk

http://rayban.shopgioia.com

http://www.oakleysunglassesfake.in.net

http://www.kate-spadeoutlet.us

http://www.coach-factoryoutlet.com.co

http://www.gucci-outlet.org

http://www.adidas-shoes.me.uk

http://ralphlauren.eshopping.us.com

http://oakley.eshopping.us.com

http://www.vipmichaelkors-outletonline.com

http://www.canadagooseuk.me.uk

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

http://www.kate-spadeoutlet.in.net

http://truereligion.adsmall.us.com

http://jordan.outletmalls.us.com

http://www.guccioutlet.net.co

http://www.nikeuk.me.uk

http://www.katespadeuk.me.uk

http://www.christianlouboutinoff.us

http://www.nikecortez.com.co

http://www.nikehuarache.com.co

Comment by xiaozhengm 51 weeks and 1 day ago

Erina Kors HandbagsOur choice of people smells includes makes like Lacoste, Store, Azzaro, Hanae Mori and Grey Flanner males, so you're able to conveniently obtaining this is the appropriate scent for that one of a kind person in your life.After that you are distinct the internet site is a proper one, an individual maybe may obtain khaki hamilton huge company logo brand bag. Websites website will certainly certainly provide the merchandise free once the truly desired impose is done. You will certainly recognize quickly. A few scenarios, you might obtain lower fee over a privileged morning. Following the Handbags Web site gets the house, you would possibly mean to support people as gadgets comprising your current fashionable outfits. Anyone make certain to be considered every one of the moment.Outlet basically any time electro-mechanical sites get product sales. Many small business owner can take this idea intended for offered or maybe imagine that they can perhaps not obtain because considerable an amount savings when they envisioned nevertheless is just not authentic. Merchants currently have profits pertaining to superb good deals of things and they are generally for the good thing about the individual which could get reduced builder bags with a component of their preliminary selling price.Michael Kors' dress won't attack retailers before winter season time, when you need to seem fantastic in the dress like this one promptly you will find a replacing that may undoubtedly comparable. Neiman Marcus provides this specific Emilio Pucci import that could definitely accomplish reputable activity from mimicing Erina Kor's early spring time glimpse today.American builder ended up being referred to as the 1st previously ladies's ready-to-wear designer in addition to imaginative manager regarding Celine inside The mid nineties. During his interval on Celine, Kors changed the structure pattern residence around together with preferred add-ons and also a considerably well-known ready-to-wear series. Kors manufactured for the actual tag getting the club 04. Italian developer Roberto Menichetti seemed to be termed imaginative boss. After a improper 12 months, Menichetti was moved away simply by Croatian creator Ivana Omazic. Omazic would have been a an earlier expert with the trademark label and previously worked having Romeo Gigli, Prada, Jil Sander, as well as Miu Miu.When the item back links in order to watches, harm exams to a Bags Website Porcelain ceramic Observe. Besides may be the brand brand synonymous with expenditures in addition to reliability, a Earthenware Watch is renowned for illustrating focus to the particular biceps regarding major celebs in addition to Fashionistas.Nowadays, plenty of manufacturers produce fake artist goods. These people recreate the style and style of genuine programmer bags, clothes, jeans, as well as add-ons. They use cost-effective as well as regular goods to breed developer labels. http://www.hermesbeltsbirkinkellybag.co.uk/ Frequently, an imitation strategy is undistinguishable from your real one. Several makers have got truly blossomed inside creating replications . associated with thousand-dollar apparel and also add-ons.Job Driveway number Heidi Klum makes certain to be kindlied whenever she seess bag providings this year. A number of cheers towards the high-rating fact TELEVISION series, is actually speedy coming over to become a household label for National design. His / her pre-existing bag collection exhibits a substantial various models through zebra-striped take bags for you to personalized grabs intended for stylishly business ladies who will always be on the road. Outdated options similar to setting up logo model attractiveness remain highlighted.

Comment by stephanieg915 1 day ago

It will always be the right conclusion should you be using component of manner handbags about low cost base. It is usually claimed because simplest way of having into fashion sector. Together with the shifting trends, it usually is basic that you follow that old or maybe existing pattern. These types of low cost handbags are available in several patterns and fashions which might be popular this also assists you to inside developing your organization in the market. If you want to turn into a handbag wholesaler, than the is the ideal option right now. In lieu of having great number of handbags which can be either acquire or perhaps sale, you are able to definitely be used as a new handbag importer. Should you at wholesale prices handbag, then there are some types of stuff that this merchants may possibly requirement of your stuff. The initial factor in this company is that if you're going to supply fashion handbags, you then ought to ensure its distribution period. The particular dealer ought to be equipped to ensure they can have confidence in an individual. It is therefore reportedly truly essential that you have to accompany a gaggle which is often counted to fulfill your output deadlines by the due date. This is usually help because overall dish when the handbag importer will come in by means of acknowledging the belief that your company might wish to fail at some point. A new handbag importer can simply become a handbag dealer. The main advantage of it is that one could take all your income since you will not need to discuss your own gains with any kind of 3rd individual. A new middleman will be the individual who is definitely more successful in the business of favor marketplace that is related to latest tendency of favor. In limited, this is often stated that this situation largely behaves as a car as a result of all of the is cancelled from the retailer who's going to be immediately managing the product or service buyer in order to manufacturer. It's a one on one earning gain company where there isn't a next one that will need profits on your part. Very first the most beneficial along with popular business these days. If you desire to find the http://www.hermesbeltsbirkinkellybag.co.uk/ nuances of this specific handbag middleman company, it is possible to make assistance of web. Internet can be said because most suitable option by which you can get details details about it. You can get all organization linked information from it and by doing this business; you can earn large level of income. A lot of people are taking the edge from this. Regarding the Author

Comment by stephanieg915 1 day ago

Your point of view

You must be signed in to comment.