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

Extract raw URLs from a file

Terminal - Extract raw URLs from a file
egrep -ie "<*HREF=(.*?)>" index.html | cut -d "\"" -f 2 | grep ://
2011-03-29 18:20:50
User: fanfani
Functions: cut egrep grep
3
Extract raw URLs from a file

you can also use cut instead of awk. less powerful but probably faster. ;)

Alternatives

There is 1 alternative - vote for the best!

Terminal - Alternatives
egrep -ie "<*HREF=(.*?)>" index.html | awk -F\" '{print $2}' | grep ://

Know a better way?

If you can do better, submit your command here.

What others think

You can do the whole thing (more successfully even) with versions of grep that support PCRE (like GNU grep).

Compare:

curl -sAOpera "http://www.google.com/search?q=linux" | grep -Pio '(?<=href=['\''"])[^:]+://[^'\''"]+' curl -sAOpera "http://www.google.com/search?q=linux" | egrep -ie "<*HREF=(.*?)>" | cut -d "\"" -f 2 | grep ://
Comment by eightmillion 303 weeks and 5 days ago

Fails if the attributes do not use " characters as start/end tokens. Does not pick up any URLs in any attributes other than HREF, nor will it recognize relative URLs and change them to absolute URLs.

Comment by Mozai 261 weeks and 5 days ago

The instance Company got the quarta movement enjoy, remodeled this employing a lesser number of components whilst keeping your functionality in addition to detail, which in turn produced a "hip watch" with merely 51 factors, consequently reduced premiums with the buyer. The particular brand-new watches took off similar to cyclone in addition to through the Eighties, if you didn't have a Piece of fabric view you are inside "in group". The newest tidy Case in point designer watches were about Eighty percent much less in cost in comparison to opponents and also supplied consumers the opportunity to discover many kind of brand-new and thrilling ways to reveal their particular individuality by the view they will chosen to put on.The confront of the around the world Several prospering areas, or even your firm's ideal "stunning success, Chairman and Principal Govt Cop of its Higher Tiongkok Lida Kang created nearly any numerous many years the high-end of the tale: Website additionally showed way of located high-end purchaser variations.After that you are certain how the world wide web web site is an actual 1, you most likely could receive Spending department khaki hamilton huge agency company logo signature bag. The online world site will surely move the things cost-free in the event the necessary costs are manufactured. You will absolutely realize immediately. Many difficulties, you could possibly in the same manner acquire economical over a fortunate day time. Following your Electric outlet Web site acquires the house, you could mean to offer you those since equipment along with your cool outfits. A person establish to become considered always.The rewarding and strong model of each brand of 70 30 sneakers is particular to turn brains, which's especially how Ce Ce Experience built them into. The lady actually brought out her true very own line of footwears under the 80 20 or so hallmark label to reveal your ex further advancement as a custom in addition to highlight a number of the woman's very best variations.Michael Kors HandbagsAssess the web based google search Ranks in the On-line Site" As you seem the Web for getting footwears, check out the to-do listing associated with internet site that appear in major rates inside on the internet on-line search engine end result website. http://www.hermesbeltsbirkinkellybag.co.uk/ Throughout occasion you might be reading for specific Footwears designate that you'll need query.Take bags are some of one of the most extremely adaptable bags close to. This Handbags household is not necessarily unsusceptible in which overview. The particular Hand bags Clair Handbag has gone out pick for the fall. The wonderful part of hold bags is actually the approval they could be made use of regarding. Just one may probably keep several task data versions, their particular Apple macbook in addition to a covering for the chilly early evenings. They furnish an fashionable whole lot much more complex method of transporting your computer or laptop about after that the main element laptop system bags presented in individuals significant pc web-sites.A brand-new peculiarities in you practical experience, the automobile speeding diary Site get definitely really nudged Newcastle's Northumberland Denture to the very first day of September and where generally there should not be became ready for any drastically excellent treatment to start out off of the treating the countless month's off of road car or truck racing. Range of left over to become obstacles ought to be while significantly cost-effective a result of the reality how the 'Pitmen's Derby' which in turn duration's race is normally no different in order to given that familiar necessity.Michael Kors is the hottest number of basic leather-based handbags that are wonderfully cool. The actual Prescott custom made household leather wallet selection characteristics dazzling layouts together with interesting details along with traditional hues. Here are a few of the most extremely current handbags from the Prescott ladies designer wallet series.

Comment by stephanieg915 6 days ago

http://www.canadagoosefemmehomme2016.fr/canada-goose-boutique-paris_167.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-parka-femme_349.html

http://www.canadagoosefemmehomme2016.fr/kensington-canada-goose_234.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-france_265.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-homme_376.html

http://www.canadagoosefemmehomme2016.fr/manteau-canada-goose-femme_44.html

http://www.canadagoosefemmehomme2016.fr/parajumpers-ou-canada-goose_87.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-modele-victoria_409.html

http://www.canadagoosefemmehomme2016.fr/goose-femme_52.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-noir_45.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-pas-cher-enfant_337.html

http://www.canadagoosefemmehomme2016.fr/doudoune-homme-canada-goose_366.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-mystique-femme_179.html

http://www.canadagoosefemmehomme2016.fr/manteau-canada-goose-a-vendre_450.html

http://www.canadagoosefemmehomme2016.fr/manteau-homme-canada-goose_82.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-expedition_381.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-femme-chilliwack_113.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-resolute_66.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-bomber-chilliwack_119.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-montebello-femme_128.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-fille_319.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-taille-s_327.html

Comment by sguerra376 4 days ago

http://www.canadagoosefemmehomme2016.fr/canada-goose-chilliwack_393.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-pas-cher_455.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-homme_376.html

http://www.canadagoosefemmehomme2016.fr/selkirk-canada-goose_77.html

http://www.canadagoosefemmehomme2016.fr/ecusson-canada-goose_168.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-summit_236.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-vrai_249.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-point-de-vente_371.html

http://www.canadagoosefemmehomme2016.fr/prix-canada-goose-new-york_215.html

http://www.canadagoosefemmehomme2016.fr/acheter-canada-goose-paris_406.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-vente_95.html

http://www.canadagoosefemmehomme2016.fr/gants-canada-goose_312.html

http://www.canadagoosefemmehomme2016.fr/adresse-magasin-canada-goose-montreal_297.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-france-boutique_218.html

http://www.canadagoosefemmehomme2016.fr/prix-d-une-doudoune-canada-goose_390.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-longue-homme_301.html

http://www.canadagoosefemmehomme2016.fr/chapeau-canada-goose_238.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-enfant_264.html

http://www.canadagoosefemmehomme2016.fr/manteau-canada-goose-homme-pas-cher_341.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-prix_395.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-prix_56.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-pas-cher-femme_305.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-bleu_63.html

http://www.canadagoosefemmehomme2016.fr/blouson-goose-canada_195.html

http://www.canadagoosefemmehomme2016.fr/manteau-canada-goose-femme-pas-cher_472.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-boutique-paris_167.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-expedition_381.html

Comment by sguerra376 4 days ago

http://www.canadagoosefemmehomme2016.fr/prix-d-une-canada-goose_130.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-mountaineer_477.html

http://www.canadagoosefemmehomme2016.fr/goose-canada-pas-cher_140.html

http://www.canadagoosefemmehomme2016.fr/forum-canada-goose_60.html

http://www.canadagoosefemmehomme2016.fr/skreslet-parka-canada-goose_469.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-kensington-parka-femme_448.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-femme-prix_362.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-com_213.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-victoria_293.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-enfant_264.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-chilliwack_393.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose-occasion_186.html

http://www.canadagoosefemmehomme2016.fr/manteau-canada-goose-homme_279.html

http://www.canadagoosefemmehomme2016.fr/veste-canada-goose-solde_198.html

http://www.canadagoosefemmehomme2016.fr/adresse-magasin-canada-goose-montreal_297.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-moncler_415.html

http://www.canadagoosefemmehomme2016.fr/site-canada-goose_352.html

http://www.canadagoosefemmehomme2016.fr/site-officiel-de-canada-goose_435.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-blanc_171.html

http://www.canadagoosefemmehomme2016.fr/goose-canada_169.html

http://www.canadagoosefemmehomme2016.fr/homme-canada-goose_350.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-suisse_41.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-femme-occasion_262.html

Comment by sguerra376 1 day ago

http://www.canadagoosefemmehomme2016.fr/acheter-canada-goose_446.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-le-bon-march��_461.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-chilliwack-homme_298.html

http://www.canadagoosefemmehomme2016.fr/manteau-femme-canada-goose_248.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-site-officiel_188.html

http://www.canadagoosefemmehomme2016.fr/shelburne-canada-goose_418.html

http://www.canadagoosefemmehomme2016.fr/hommes-canadian-goose_102.html

http://www.canadagoosefemmehomme2016.fr/ou-acheter-une-canada-goose_313.html

http://www.canadagoosefemmehomme2016.fr/parajumpers-canada-goose_203.html

http://www.canadagoosefemmehomme2016.fr/montebello-parka-canada-goose_287.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-veste-femme_363.html

http://www.canadagoosefemmehomme2016.fr/blouson-canada-goose-homme_467.html

http://www.canadagoosefemmehomme2016.fr/vetement-canada-goose_368.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-rouge_118.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-canada_386.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-tuque_58.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-femme-noir_114.html

http://www.canadagoosefemmehomme2016.fr/pas-cher-canadian-goose_219.html

http://www.canadagoosefemmehomme2016.fr/acheter-canada-goose-pas-cher_124.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-sans-fourrure_311.html

http://www.canadagoosefemmehomme2016.fr/manteau-canada-goose-femme-pas-cher_472.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-blanche_295.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-montebello-femme_373.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-foxe_91.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-taille-s_327.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-pour-femme_475.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-homme-prix_329.html

Comment by sguerra376 1 day ago

Your point of view

You must be signed in to comment.