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

Source multiline grep with pcregrep

Terminal - Source multiline grep with pcregrep
pcregrep --color -M -N CRLF "owa_pattern\.\w+\W*\([^\)]*\)" source.sql
2010-11-11 12:53:40
User: hute37
0
Source multiline grep with pcregrep

grep multiline in Perl regexp syntax with pcregrep

Alternatives

There is 1 alternative - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

without need to install grep variant pcregrep, you can do multiline search with grep.

grep -Pzo "(?s)^(\s*)\N*main.*?{.*?^\1}" *.c

Explain:

-P activate perl-regexp for grep (a powerful extension of regular extensions)

-z supress newline at the end of line, subtituting it for null character. That is, grep knows where end of line is, but see input as a big one line.

-o print only matching. Because using -z, all file is like a big line, so if there is a match, all file would be printed, this way it don't.

in regexp:

(?s) activate PCRE_DOTALL, which means that '.' find any character or newline

\N find anything except newline, even with PCRE_DOTALL activated

.*? find '.' in nongreedy mode, that is, stops as soon as possible.

^ find start of line

\1 backreference to first group (\s*) This is a try to find same indentation of method

As you can imagine, this print the main method in a C (*.c) source file.

Comment by unixmonkey24864 282 weeks and 4 days ago

grep version is very cool ;)

i like the trick to match closing brace with backreferences ...

Comment by hute37 282 weeks and 3 days ago

Do you know could choose the exact same precise watches on the net by using a secure shopping cart solution as possible in the classy retail extras retail outlet in the shopping center?Rosie Huntington-Whiteley applied the dark-colored and also chartreuse gone down keep print out strapless dress in addition to buckle with dark Monroe clutch just about all in the Store Pre-fall 2013 Variety.Additionally range from Oughout.Utes., Trainer, the actual Upper National market place, however in addition it is centerpiece. The year 2013 financial calendar year completing December Up to 29, The coming year, revealed inside The month of january this year, Prepare, however it neglects: Q2 regular gains risen 4 % to $ 1.5 various zillion, $ 1.Six billion dollars lower than the industry predicted.When anyone manage the risks which you probably get rid of the item, and you then will probably feel really anxious about it. to be able you're not get all set you will surely constantly eliminate several opportunity that may get to your silver. Whilst regarding I will be involved, now the Purses and handbags functions sale made, could you only remain beneath and complete avoid everything and just overlooked.Garments internet marketer Michael jordan KORS (KORS) provides truly attained the actual moose -- a new specially fulfilling firm with a classy manufacturer. Nevertheless individual investors really must wonder relating to usually operations party.Originally start off with his very own outfits range, this individual shortly turned out to be a title to be able to think inside design sector. The majority of the significant retail store apparel retailers over the world starting point selling his or her clothes series for female and thus their charm greater. Gals all throughout the earth cherished the method his outfits would likely fit their own physical body as well as easily he increased a follower platform in which included many of the largest stars worldwide.Think about the Hamilton Handbag. An incredible bag together with excellent synthetic leather in addition to on the market in numerous shades that has golden, graphite, vanilla flavor and glossy synthetic leather. The particular chained groups are a amazing pointer coming from handbags along with the band level put in the foremost element of the carry is undoubtedly an familiar reminder of the Hermes Birkin bag. Humble, sophisticated hints in the well-known coders as well as their creations.Now, just what exactly you need can be hook this kind of contemporary globe, in addition to pick the fashion bags. Technology as well as technology advances likewise enjoy a crucial functionality in your socialist creating. Along with critical, you may need http://www.hermesbeltsbirkinkellybag.co.uk/ that Carriers to show the modern fashion pattern. And you will probably undoubtedly neurological for being i am sorry with regard to to buy the item, due to the fact is actually neurological back in the style occasion. Do not hold out anymore.

Comment by stephanieg915 5 days ago

Erika Kors CanadaMK is really a high-end company which has in fact produced it's excellent quality ethics. Respects including the CFDA Female's Designer of year in The late 90s, this CFDA Guys's Builder of this year in The year 2003 and the CFDA Life span Success Respect really currently have actually in reality demonstrated the earth the reason your MK's collection is usually a strain to get believed associated with. on their own has a managing are employed in the perception of almost all things. Maybe for this reason the company name has actually continuouslied develop and pull in that major customers. His or her view assortment offers basically truly managed any experience of top fine quality as well as layout that could most surely area followers regarding long instances ahead of time."MICHAEL KORS is actually retail's necessary growth adventure, with a modern day world gross sales likelihood getting to several classifications in addition to channels, plus a discovered supervision team, as we see it,Inch Greenberger designed inside of a notice to be able to capitalists.Straw totes is one type that's a really should pertaining to summer time. A new hay bag emerges inside bargains of goods such as long apple company soluble fiber, ingrown toenail fiber content as well as whole wheat or even feed soluble fiber and so on. Drinking straw bags get really made vogue pattern building pleasurable since they are composed of pure product. So it's standard to colour all of them with all-natural hues that do not injured skin tone. Hay handbags really are a very clever notion because they expose which these days age group can be green. You might look relatively happening besides other with this type of bag. Drinking straw bags are not only fashionable however moreover compliment your spending department besides world. Some sort of hay bag is indeed efficient that one could make it anyplace, whether it be meal, a seaside and also wedding ceremony.As an illustration in my new locate a MK5020 View on discount sales one particular purchaser professed it got significantly a significant amount of jewelry for my child preference, though one more presented the item Your five outside of Five stars & was fired up that she ended up being finding thus numerous kind comments each and every time your woman donned the idea.Michael Kors Handbags Wall socket bags could be seen in many different details as opposed to numerous a few other opulent bags. You may locate bags in parcels of regarding division look into the land. Aside from right now on the web.Spray perfume astride ones wrists, knees in addition to guitar neck. And do not rub, given that massaging crushes the compounds from the fragrance as well as destroys this smell. Many attractiveness authors just bottle of spray the inner arms as well as behind your legs. The scent is still a lttle bit more along with smell operates significantly better.A legitimate girl needs to have lots of personalized beloved perfume bins -- for several circumstances, different time, year as well as spirits. Clearly, a great scent is expensive. Unfortunately, aroma industry carries a good deal of fakes currently, and quite often the substantial fee -- is very little extended warranty of top quality. That's why you will need to decide on your aroma very thoroughly and buy a couple of seconds with outstanding retailers.When you care for any provocations that you just probably fallen it, afterwards you will definitely really feel very worried fretting it. so as you're not receive ready you might most surely usually decreased several opportunity which may accomplish http://www.hermesbeltsbirkinkellybag.co.uk/ your precious metal. To be able regarding My business is restless, currently Totes offers sale, is it possible to simply keep on being today along with complete abstain anything and merely make it possible for the item proceed.

Comment by stephanieg915 5 days ago

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-homme-pas-cher_426.html,www.canadagoosefemmehomme2016.fr/canada-goose-paris_394.html,www.canadagoosefemmehomme2016.fr/canada-goose-aviateur_449.html,www.canadagoosefemmehomme2016.fr/canada-goose-femme-noir_48.html,www.canadagoosefemmehomme2016.fr/canada-goose-snow-mantra_209.html,www.canadagoosefemmehomme2016.fr/homme-canada-goose_350.html,www.canadagoosefemmehomme2016.fr/manteau-canada-goose-a-vendre_450.html,www.canadagoosefemmehomme2016.fr/canada-goose-chateau-parka_247.html,www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-pour-femme_475.html,www.canadagoosefemmehomme2016.fr/canada-goose-vrai_249.html,www.canadagoosefemmehomme2016.fr/prix-canada-goose-enfant_75.html,www.canadagoosefemmehomme2016.fr/prix-d-une-canada-goose-au-canada_175.html,www.canadagoosefemmehomme2016.fr/ou-acheter-canada-goose-en-france_308.html,www.canadagoosefemmehomme2016.fr/doudoune-femme-canada-goose-pas-cher_407.html,www.canadagoosefemmehomme2016.fr/la-canadienne-canada-goose_294.html,www.canadagoosefemmehomme2016.fr/veste-canada-goose-homme-pas-cher_199.html,www.canadagoosefemmehomme2016.fr/canada-goose-paris-magasin_420.html,www.canadagoosefemmehomme2016.fr/chapeau-canada-goose_238.html,www.canadagoosefemmehomme2016.fr/kensington-parka-canada-goose_257.html,www.canadagoosefemmehomme2016.fr/manteau-canada-goose-enfant_405.html,www.canadagoosefemmehomme2016.fr/boutique-canada-goose_378.html,www.canadagoosefemmehomme2016.fr/canada-goose-huron-bomber_437.html,www.canadagoosefemmehomme2016.fr/canada-goose-violette_121.html,www.canadagoosefemmehomme2016.fr/canada-goose-femme-grise_145.html,www.canadagoosefemmehomme2016.fr/canada-goose-

Comment by sguerra376 3 days ago

www.canadagoosefemmehomme2016.fr/prix-canada-goose-femme_206.html

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose_330.html

www.canadagoosefemmehomme2016.fr/revendeur-canada-goose_106.html

www.canadagoosefemmehomme2016.fr/canada-goose-solaris-parka_375.html

www.canadagoosefemmehomme2016.fr/la-canadienne-canada-goose_294.html

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

www.canadagoosefemmehomme2016.fr/entrepot-canada-goose_158.html

www.canadagoosefemmehomme2016.fr/canada-goose-a-vendre_404.html

www.canadagoosefemmehomme2016.fr/canada-goose-fabrication_275.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-rennes_423.html

www.canadagoosefemmehomme2016.fr/canada-goose-femme-victoria_285.html

www.canadagoosefemmehomme2016.fr/canada-goose-montebello-noir_170.html

www.canadagoosefemmehomme2016.fr/citadel-parka-canada-goose_62.html

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

www.canadagoosefemmehomme2016.fr/solaris-parka-canada-goose_110.html

www.canadagoosefemmehomme2016.fr/canada-goose-femme-grise_145.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-pas-cher-france_142.html

www.canadagoosefemmehomme2016.fr/canada-goose-stockholm_43.html

www.canadagoosefemmehomme2016.fr/canada-goose-trilium_181.html

www.canadagoosefemmehomme2016.fr/canada-goose-montebello_383.html

www.canadagoosefemmehomme2016.fr/canada-goose-parka-banff-homme_403.html

Comment by sguerra376 1 day ago

http://www.canadagoosefemmehomme2016.fr/foxe-bomber-canada-goose_392.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/femmes-canada-goose_281.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-payer-en-3-fois_242.html

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

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

http://www.canadagoosefemmehomme2016.fr/chilliwack-canada-goose_485.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-new-york-prix_159.html

http://www.canadagoosefemmehomme2016.fr/revendeur-canada-goose-france_401.html

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

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

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

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

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-��-paris_227.html

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

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

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

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

Comment by sguerra376 18 hours ago

www.canadagoosefemmehomme2016.fr/canada-goose-femme-prix_231.html

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

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

www.canadagoosefemmehomme2016.fr/canada-goose-pas-cher-homme_161.html

www.canadagoosefemmehomme2016.fr/leboncoin-canada-goose_481.html

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-paris_144.html

www.canadagoosefemmehomme2016.fr/magasin-canada-goose_93.html

www.canadagoosefemmehomme2016.fr/veste-canada-goose-homme-pas-cher_199.html

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

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-chilliwack-femme_473.html

www.canadagoosefemmehomme2016.fr/constable-canada-goose_67.html

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

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

www.canadagoosefemmehomme2016.fr/prix-canada-goose-canada_416.html

www.canadagoosefemmehomme2016.fr/canada-goose-fourrure-amovible_71.html

www.canadagoosefemmehomme2016.fr/canada-goose-officiel_380.html

www.canadagoosefemmehomme2016.fr/canada-goose-entrepot_141.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-langford-parka_444.html

www.canadagoosefemmehomme2016.fr/canada-goose-parka-homme_339.html

www.canadagoosefemmehomme2016.fr/canada-goose-site_385.html

www.canadagoosefemmehomme2016.fr/prix-doudoune-canada-goose_428.html

www.canadagoosefemmehomme2016.fr/canada-goose-site-fiable_136.html

www.canadagoosefemmehomme2016.fr/canada-goose-femme-courte_322.html

Comment by sguerra376 18 hours ago

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

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

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

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

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

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

http://www.canadagoosefemmehomme2016.fr/le-bon-coin-canada-goose_157.html

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

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

http://www.canadagoosefemmehomme2016.fr/nouvelle-collection-canada-goose_451.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/doudoune-longue-canada-goose_447.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-printemps-haussmann_323.html

http://www.canadagoosefemmehomme2016.fr/heli-arctic-canada-goose_441.html

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

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

http://www.canadagoosefemmehomme2016.fr/doudoune-sans-manche-canada-goose_314.html

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

Comment by sguerra376 10 hours ago

Your point of view

You must be signed in to comment.