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

List of commands you use most often

Terminal - List of commands you use most often
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
2009-02-11 13:12:29
Functions: awk sort
111
List of commands you use most often

Alternatives

There are 2 alternatives - vote for the best!

Terminal - Alternatives
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo 'plot "/tmp/cmds" using 1:xticlabels(2) with boxes')
2010-06-13 23:35:13
User: sthrs
Functions: awk echo head sort
14

Plot your most used commands with gnuplot.

history | awk '{a[$'$(echo "1 2 $HISTTIMEFORMAT" | wc -w)']++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
2010-05-02 21:48:53
User: bandie91
Functions: awk echo sort wc
Tags: history awk wc
0

If you use HISTTIMEFORMAT environment e.g. timestamping typed commands, $(echo "1 2 $HISTTIMEFORMAT" | wc -w)

gives the number of columns that containing non-command parts per lines.

It should universify this command.

history | awk '{if ($2 == "sudo") a[$3]++; else a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
HISTTIMEFORMAT='' history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head > /tmp/cmds ; gnuplot -persist <<<'plot "/tmp/cmds" using 1:xticlabels(2) with boxes'
2010-06-17 17:38:16
User: narcelio
Functions: awk head sort
-1

This alternative cleans HISTTIMEFORMAT environment variable and calls gnuplot just after /tmp/cmds is closed, to avoid some errors.

Know a better way?

If you can do better, submit your command here.

What others think

It didn't work properly for me I used "history -$HISTSIZE" against just "history" to sue the full history and not only the 10th firsts.

my correction is then

history -$HISTSIZE | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head

Comment by yogsototh 414 weeks ago

since i got dates on my commands this one works better for me using the 4th column

history | awk '{a[$4]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head

Comment by bbelt16ag 412 weeks and 3 days ago

use this! more portable

history | awk '{a[$'`echo "1 2 $HISTTIMEFORMAT" | wc -w`']++}END{for(i in a){print a[i] "\t" i}}' | sort -rn | head

Comment by bandie91 409 weeks ago

history | sort -k2,3 | uniq -f 1 -c | sort -rn | head

Comment by taliver 373 weeks and 6 days ago

Arranges it in columns, and with a variable number of results. Use $ mostused NUMBERTOSHOW

mostused() { history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | ( echo "USES COMMAND" && head -n $1 ) | column -t; }
Comment by AtkinsSJ 351 weeks and 5 days ago

When you presume of womens health club bags, a person immediately suppose within your well-designed small gymnasium bag that will matches the objective of holding gymnasium outfits, deodorant, surplus footwear, any budget or even smaller hand handbag, and perhaps a lightweight jacket just in case this down pours.Designed especially for the lady business women, the regular health club bag is created inside superb colors, one of the most up-to-date model and materials. A little brighter, it meets the woman frame superior versus the more heavy male's bag does. In addition, the female bags have added in abilities and numerous compartments for carrying non-public things.The best selection depends for that lady along with the girl way of life * your ex budget, exclusive design, exactly what amount of fitness center programs she does indeed, exactly how expert she's in regard to various other methods as well as, what exactly likes she's got with bags!What's popular with a single lady is probably not such as by several people, this type of will be the planet we all are in. Ladies are usually adaptable, therefore the girl could possibly maintain a couple different developed bags circular to match her mood and trend interest from the time. Likewise, your bag would like to commonly be water resistant to reject dampness as well as normal water when the girl bath areas within the gymnasium.Several go direct for the fitness center from home or perhaps work. This implies possessing a effectively developed bag to maintain near to throughout the day, rather classy nonetheless not to nice.The bag also need to find more compact in proportions, lighter weight to keep approximately, along with needs to be sleek and stylish for easier storage area even though at the office. The colours regarding could gym bags stand for your ex feminine part : pink, soft lime, mineral-washed natural denim, bowler give bags, yoga exercises bags and the ones with graphics with them. The pad is in addition unique, for example tote group, health and fitness center carriers, duffle bags, bowler side or perhaps the common leather-based sort.An essentially best suited location to go shopping for the girls health and fitness center bags should be to use the internet - a wide open place to looking globally devoid of causing your solitude with your property. Girls are typically lookup connected with one thing extraordinary as well as other that no-one different possesses. There may be next to nothing superior to Internet shopping for an products and that is halfway through the planet at 1 / 2 the significance you generally might pay. It genuinely aren't able to have any in excess of this, does it? Toss a bit free of charge delivery within along with the bag invest in is up to you.Women's health and fitness center bags make exceptional gifts for outside ladies or perhaps girls who're productive. By internet shopping, it is possible to look over the actual designs and discover http://www.hermesbeltsbirkinkellybag.co.uk/ what exactly is for sale inside your common designs and colors. You will find lots of kinds to make a decision out, it could actually well be suitable for you out numerous tips and pay attention to in case she may fall some tips to assist your choice making.

Comment by stephanieg915 1 day ago

It's possible women of all ages were created while using habit of loving the actual bags, especially those fashionable bags. I don't know anyone, on the other hand, a trendy gal, possess a strong experience on the bags specifically to be able to fashionable bags for sale. As i has been small, I became therefore in love with the trendy bags. While various other youngsters moved the beautiful bags to attend university, I began to cart my own mother's hobo bag to varsity, which in turn forced me to a focus with the university. I actually liked that type connected with sensation that has been different from other individuals.Now I've got converted to a sweetheart who is enthusiastic about hobo bags. I favor obtaining a myriad of hobo bags, also I will be at my own life is threat.Once My partner and i read that will popular bags had been for sale along with hobo bags have been integrated, which in turn forced me to so energized which i could hardly get into rest the entire night. The very next day I acquired right up and so early on as well as in a rush on the area. The bags on sale failed to let down myself, i enjoy plenty of treasure. On my way property, I was thinking the volume of hobo bags I did accumulated, a body fat and ungainly male together with fat experience threatened me handy our bags for you to your ex, or even I might possibly be murdered by means of http://www.hermesbeltsbirkinkellybag.co.uk/ his or her weapons. May be the man furthermore stood a excellent eyesight for your hobo bags and also seen that it was likely to be considered a propensity to the popularity of hobo bags. I had been and so mad with his behaviours and overlooked his / her words and phrases and I overcome them using our bags. I became consequently fortuitous which that man had been pass out, or even I might always be killed through their guns.That seemed to be me personally, a stupid woman who was willing to expire in my favourite bags. Perhaps Used to in which impulsively, yet hobo bags really have most of these expensive jewelry to do that. Have you been crazy about this hobo bags since myself? For anyone who is in addition fond of these, you ought to sense extremely pleased. It truly is well worth. Well, i wish to become excited about that.Everything on earth features good reasons in addition to outcomes, tend not to sense regretted on your habits. Once you're excited about another thing which communicate it gets the exclusive necklaces in your case. Merely think your personal face as well as knowing capacity, and never permit the things change from a hand if you have chosen this. Apart from, there are lots of gifts in the bags on discount sales in case you be tied to and hunting the idea meticulously. We are in love with the sensation to find hold dear the type of bags for sale.

Comment by stephanieg915 1 day ago

www.canadagoosefemmehomme2016.fr/canada-goose-chapka_342.html,www.canadagoosefemmehomme2016.fr/acheter-canada-goose_446.html,www.canadagoosefemmehomme2016.fr/canada-goose-parka_61.html,www.canadagoosefemmehomme2016.fr/vetement-goose-canada_345.html,www.canadagoosefemmehomme2016.fr/canada-goose-site_385.html,www.canadagoosefemmehomme2016.fr/canada-goose-new-york-price_202.html,www.canadagoosefemmehomme2016.fr/nouvelle-canada-goose_193.html,www.canadagoosefemmehomme2016.fr/blouson-canada-goose-homme_467.html,www.canadagoosefemmehomme2016.fr/canada-goose-outlet-france_122.html,www.canadagoosefemmehomme2016.fr/vente-canada-goose-montreal_160.html,www.canadagoosefemmehomme2016.fr/femme-canadian-goose_104.html,www.canadagoosefemmehomme2016.fr/manteau-canada-goose_433.html,www.canadagoosefemmehomme2016.fr/canada-goose-violette_121.html,www.canadagoosefemmehomme2016.fr/bomber-canada-goose_240.html,www.canadagoosefemmehomme2016.fr/livigno-canada-goose_72.html,www.canadagoosefemmehomme2016.fr/veste-style-canada-goose_223.html,www.canadagoosefemmehomme2016.fr/magasin-canada-goose_93.html,www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-pas-cher_192.html,www.canadagoosefemmehomme2016.fr/canada-goose-tuque_58.html,www.canadagoosefemmehomme2016.fr/homme-canadian-goose_180.html,www.canadagoosefemmehomme2016.fr/canada-goose-expedition-homme_207.html,www.canadagoosefemmehomme2016.fr/site-officiel-de-canada-goose_435.html,www.canadagoosefemmehomme2016.fr/promo-canada-goose_263.html,www.canadagoosefemmehomme2016.fr/comment-reconnaitre-une-canada-goose_478.html,www.canadagoosefemmehomme2016.fr/canada-goose-grise-homme_468.html,www.canadagoosefemmehomme2016.fr/taille-canada-goose_79.html,www.canadagoosefemmehomme2016.fr/manteau-canada-goose-pas-cher_42.html,www.canadagoosefemmehomme2016.fr/veste-canada-goose-femme-pas-chere_357.html,www.canadagoosefemmehomme2016.fr/palliser-canada-goose_261.html,www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-femme-pas-cher_65.html,www.canad

Comment by sguerra376 14 hours ago

Your point of view

You must be signed in to comment.