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.

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:



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!

Top Tags



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

Prints per-line contribution per author for a GIT repository

Terminal - Prints per-line contribution per author for a GIT repository
git ls-files | xargs -n1 -d'\n' -i git-blame {} | perl -n -e '/\s\((.*?)\s[0-9]{4}/ && print "$1\n"' | sort -f | uniq -c -w3 | sort -r
2009-10-25 01:44:03
User: askedrelic
Functions: perl sort uniq xargs
Prints per-line contribution per author for a GIT repository

Figures out total line contribution per author for an entire GIT repo. Includes binary files, which kind of mess up the true count.

If crashes or takes too long, mess with the ls-file option at the start:

git ls-files -x "*pdf" -x "*psd" -x "*tif" to remove really random binary files

git ls-files "*.py" "*.html" "*.css" to only include specific file types

Based off my original SVN version: http://www.commandlinefu.com/commands/view/2787/prints-total-line-count-contribution-per-user-for-an-svn-repository


There are 2 alternatives - vote for the best!

Terminal - Alternatives
git ls-files | xargs -n1 git blame --line-porcelain | sed -n 's/^author //p' | sort -f | uniq -ic | sort -nr
2012-06-02 22:04:36
User: hugopeixoto
Functions: sed sort uniq xargs
Tags: statistics git

Uses line-porcelain in git blame, which makes it easier to parse the output.

git ls-files | while read i; do git blame $i | sed -e 's/^[^(]*(//' -e 's/^\([^[:digit:]]*\)[[:space:]]\+[[:digit:]].*/\1/'; done | sort | uniq -ic | sort -nr
2009-10-25 09:40:01
User: pipping
Functions: read sed sort uniq
Tags: statistics git

You'll run into trouble if you have files w/ missing newlines at the end. I tried to use

PAGER='sed \$q' git blame

and even

PAGER='sed \$q' git -p blame

to force a newline at the end, but as soon as the output is redirected, git seems to ignore the pager.

Know a better way?

If you can do better, submit your command here.

What others think

It should be:

... -i git blame {} ...

instead of:

... -i git-blame {} ...
Comment by takeshin 345 weeks and 3 days ago

Not working on mac due to xargs -i and uniq -w. I tried to hack it, but no go.

Comment by unixmonkey69095 168 weeks ago

Even though the woman is commonly the focal point of a wedding ceremony, the groom's clothes need to enhance bride. Switch flop dress new sandals for guys usually are with no adornment seen on sandals for ladies, but are nevertheless appropriate for the seaside wedding party. Mens make use of fall down dress shoes are usually for sale in white-colored in addition to natural colours, including tan, dark, as well as brown leafy.Do you use a handbag as well as would like you could? Many find that a tremendous problem they have for buying an authentic handbag should be to need to cough up the bucks for example. Not everybody provides $200-$1600 simply just sitting around for you to shop using a handbag. Thus, acquiring these handbags with regard to discounted prices is a superb resource with the consumer to possess.Now we need value existence along with manner trend, nearly all men and women such as the structure dress go shopping, including Handbags is pretty design layout, the idea the outstanding high-quality regarding audio, the item usually create people excellent experience.The Prada Cervo Carry has got the classic look of small business having beautiful platinum details. This particular becoming developer bag incorporates a acceptable removable glenohumeral joint straps, useful breeze end, pretty steel gear fine detail, short buckskin top rated manages, a dangling bags draw, large inside squat jean pocket, personal jacquard coating, band features, signature bank Prada front side silver logo and well designed metal tone electronics. This specific popular buckskin carrier handbag consists of deer buckskin and is accessible in the shades wine red along with black color. For additional offered colorings, go to Prada on-line.When it issues http://www.hermesbeltsbirkinkellybag.co.uk/ designer watches, you will find several opinions to some Internet site On the net Porcelain ceramic Enjoy. Not only will be the manufacturer linked with top-notch in addition to exactness, the Porcelain Watch is actually know pertaining to adorning your biceps and triceps connected with major tremendous stars as well as Hollywood superstars.If you happen to be acquiring designer bags regarding all on your own and for re-sale , nor recommend to cover costly expenses, there's a good deal of options. A large amount of programmer bags usually are handily obtainable in a multitude of techniques and so they do not include limiting a new weeks pay check to buy them. Stick to the tips below to view how you will might obtain low-priced Handbags bags in a number of stores.Michael Kors SaleThe selection of fragrances your current fishing boat take a trip dispatch holds will certainly depend on your cruise trip range. Plenty of ship journey boats manage to help share an attractive good choice of goods. Hunt for several massive superstars (Givenchy,, Lancome, and more) and many newer brands (DKNY, Store, Observara Wang).This informal Prada bag provides more than enough room which is the best addition for slip. The particular Prada Nylon Jacquard Carrier features a useful breeze drawing a line under for straightforward entry, a pair of prime synthetic leather deals with, a stylish ruched leading, unique jacquard coating, sizable inside zero pocket, aspect chain tassels along with drawstring cinch design and signature Prada the front silver logo design. This particular classy day-to-day carrier is made of plastic and is available in the colors black and red. For much more obtainable shades, stop by Prada on the web.

Comment by stephanieg915 2 days ago

The Wine Preference, The place that the Luxury is within the Cost savings Real Custom made Handbags regarding 90% down, it\'s high time! My A bottle of champagne TasteWhere the luxurious is incorporated in the Savingsits About Time! At My own A bottle of champagne Tastes, the luxurious is within the price savings along with genuine developer handbags intended for 90% down! The A bottle of champagne Flavor http://www.hermesbeltsbirkinkellybag.co.uk/ can be an fascinating brand new on the net penny auction site that has traditional custom handbags, add-ons and also top notch department store on the net in both anything public auction or maybe a purchase it today solution. Several of the incredible merchandise from that cent market consist of authentic developer handbags, on the net and also other components by these kinds of common in addition to well known brands as Prada,, Fendi, Saks as well as Bloomingdales. At this specific on-line dime auction, offers are bought upfront pertaining to.50-.99 pence each. This additional highest taker payment means that exclusive market prices for bids are placed by means of severe customers only. Many deals begin at $0.02 without having reserve. Your public auction price raises by 2 pennies if a bet is defined with a prospective buyer. Also, the public auction cooking timer increases with a minimum of 10 seconds with every bid, making it possible for most bidders the opportunity to place a wager equally as they might get inside a traditional market. If the auction clock reaches absolutely no, the ultimate bidder makes as much as 90% off of the shop price from the auctioned merchandise. No prospective buyer results in your dollar public sale bare presented with. A new get it today option is accessible to those visitors that shed the any amount of money public auction and still need to buy one in our legitimate custom made handbags, on line and other great merchandise at a lower price. Together with the get it currently solution, the item emerges on sale similar to the particular shop price on the product without the presence of importance of the particular bids inserted with that certain bidder on your online any amount of money auction. At My A bottle of champagne Preference, the vision is usually to give each of our users with all the best genuine custom made handbags along with other items whilst providing top of the line customer support. Most things on offer at this on the web dollar auction tend to be guaranteed to possibly be brand new in addition to entirely traditional solutions. The items obtained on our dime auction website is shipped having guarantee in addition to credibility paperwork to help point out each of our dedication to quality.

Comment by stephanieg915 1 day ago

Your point of view

You must be signed in to comment.