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

Analyse an Apache access log for the most common IP addresses

Terminal - Analyse an Apache access log for the most common IP addresses
tail -10000 access_log | awk '{print $1}' | sort | uniq -c | sort -n | tail
2009-01-25 21:01:52
User: root
Functions: awk sort tail uniq
Analyse an Apache access log for the most common IP addresses

This uses awk to grab the IP address from each request and then sorts and summarises the top 10.


There is 1 alternative - vote for the best!

Terminal - Alternatives
zcat access_log.*.gz | awk '{print $7}' | sort | uniq -c | sort -n | tail -n 20

Know a better way?

If you can do better, submit your command here.

What others think

How to make it continuously tail the log-file and update the top10?

Comment by vlur 413 weeks and 5 days ago

Ok, got it, "watch -n 1 command"

Comment by vlur 413 weeks and 2 days ago
awk 'NR<=10000{a[$1]++}END{for (i in a) printf "%-6d %s\n",a[i], i|"sort -n"}' access.log
Comment by point_to_null 408 weeks and 4 days ago

Ok, now lets say I want to count it only from a specific accessed HTML/PHP page?

Comment by alexbleks 68 weeks ago

Today, authorities are generally banning the particular cheap bags as they are really harmful with the atmosphere. They are not only spoiling the atmosphere, and also affecting the creatures. It is, precisely why the majority are generally transitioning to friendly to the environment bags that don't cause global warming. More and more people are getting aware of this devastating results of poisonous factors present in plastic-type. Therefore, they've got started out applying environmentally friendly bags for instance 100 % cotton bags, paper bags, non-woven bags, nylon bags along with jute bags. Cotton is actually gentle, natural cellulose along with normal fiber that is stitched into the twine so as to make pure cotton materials. Pure cotton materials can be used as various reasons like apparel, bags, along with fabrics. You could find kinds of natural cotton just like organic cotton, re-cycled 100 % cotton, along with natural and organic natural cotton. The thing concerning the natural and organic pure cotton would it be is actually developed without using any compound manure. Alternatively remade natural cotton comes from business small bit as well as natural cotton scrap associated with natural pure cotton. Natural cotton is actually discriminating over a land and that is clear of pesticides along with manure utilization for more than 10-20 years. Therefore, every one of the Three or more types of 100 % cotton are generally highly practical as well as rather eco-friendly. Cotton bags have gotten very well liked in the present situation. The real reason for that is that these bags tend to be naturally degradable. It implies they can supply all the time because they are long lasting and just cleanable. Certainly, these are an even more versatile choice than the plastic material bags. Right now, several supermarkets are offering to you organic cotton bags insurers instead of the cheap carriers since these bags are selling some assistance in reducing wipeout of the earths. Cotton bags, in particular the cotton shoppers bags, are http://www.hermesbeltsbirkinkellybag.co.uk/ perfect tool with regard to campaign likewise. These kind of bags are not only found cheaper, but can be used to promote your current brand. By simply presenting organic cotton purchasers bags, you're not only avoiding environmental surroundings via degrading, but in addition selling your current brand names title inside an successful as well as more affordable approach.Exhibition bags may also be inexpensive selection for marketing by yourself. These kinds of bags are wonderful discount resources in the course of events, industry events, along with company situations.

Comment by stephanieg915 1 day ago




























Comment by sguerra376 7 hours ago

Your point of view

You must be signed in to comment.