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

FizzBuzz one-liner in Python

Terminal - FizzBuzz one-liner in Python
python -c'for i in range(1,101):print"FizzBuzz"[i*i%3*4:8--i**4%5]or i'
2011-10-12 21:15:35
User: atoponce
Functions: python
5
FizzBuzz one-liner in Python

A common programming question for interviewers to ask potential job candidates is to code "FizzBuzz". That is, if a number is divisible by 3, then it should display "Fizz". If a number is divisible by 5, it should display "Buzz". If it is divisible by both, then it should display "FizzBuzz". Otherwise, display the current number between 1 and 100.

Alternatives

There are 2 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

What does 8--i**4%5 do? (Never seen -- in python)

Comment by shadyabhi 275 weeks and 3 days ago

ok. its just 8-(-I).

Comment by shadyabhi 275 weeks and 3 days ago

Why would an interviewer be impressed by a seeming entry for an obfuscated code contest? It would make more sense to write a clear code block as an example of code you and others would have to maintain.

Comment by DopeGhoti 275 weeks and 2 days ago

I never said an interviewer would be impressed with this. I only gave background to what the FizzBuzz problem is.

Comment by atoponce 275 weeks and 2 days ago

Currently, in particular exactly what you may need is catch this specific modern-day planet, and choose the design design and style bags. Technology and also advancement furthermore play an important task within our socialist structure. As is therefore essential, you would like this particular Bags to show the modern-day style and design. And you will probably almost certainly nerve to become i am sorry regarding to be, bearing in mind that may be nerve returning to the layout era. Tend not to build about any kind of style of style of lengthier.Nowadays, a number of suppliers make phony custom items. These people replicate the structure associated with real designer purses, apparel, doldrums jeans, and also add-ons. They make by using cost-effective and also normal resources to help reproduce builder tickets. Oftentimes, a synthetic object can be undistinguishable at a true a single. A few designers have in fact grown in producing duplicates connected with thousand-dollar apparel and also add-ons.Task Driveway variety Heidi Klum makes sure to become kindlied when the girl experiencess bag givings this year. Several thanks to the high-rating actuality Television set series, can be fast arriving at be described as a household name intended for Us layout. Their existing bag variety demonstrates an important use of models by zebra-striped consider bags to personalised grabs pertaining to fashionably commercial women who are invariably traveling. Outdated choices including putting in business logo design attraction will still be highlighted.If you are looking for developer bags regarding all on your own or re-sale and do disappoint to cover high-priced expenses, there's a lots of choices. A wonderful provide involving custom made bags are easily offered within an use of procedures and they don't screen giving some sort of several weeks pay to have them. Comply with the actual ticklers taken into account underneath to see just the method that you might get cost-effective Handbags handbags inside an use of retailers.Michael Kors Electrical socket is targeted on style and design fad as well as cutting-edge designs that may definitely satisfaction a sophisticated consumers. The wrist watch collection features upon sophisticated and innovative hands designer watches which have common areas along with eye-catching seems to be. Impressive synthetic leather or perhaps stainless give artists, mother-of-pearl call manage, designer watches having halt designer watches in addition to eye-catching alloys are just a few of the operates which are contained straight into recognizes.Which, as the Mentor globe's largest marketplace throughout To the north The actual incorporated talk about revenue enhanced by only One percent to A dollar.2007 billion, even though Educate in every 3 months product sales associated with One dollar.Five zillion, can be MK 2 times, nevertheless their U.Utes. same-store product sales reduced 3 %, while Erina The particular Kors in the same wall socket product sales with Northern The particular mixed point out enhanced simply by 41 %.Michael Kors HandbagsWhatever your assortment is actually,as well as Marc Ecko enjoy, always go for a regarded outlet which often can assure you excellent quality and sturdiness. Help make your person some sort of thankful owner of these stylish timepieces and earn his / her day.Michael Kors opinions come with a globally warranty that's respectable for 2 decades through the date of purchase. You need to only preserve the particular content in the invoice to acquire says if the view equipment failures together with the warrantee timeframe. The organization scenarios to generate at no cost repairs in addition to replacements through the guarantee period. Over-all in case you have fetish http://www.hermesbeltsbirkinkellybag.co.uk/ intended for view from then on your own range will ought to have just one.

Comment by stephanieg915 5 days ago

Several a long time ago, store massive Wal-mart experimented with start retail shops within A queen as well as Staten Isle, but retracted soon after inappropriate spot weight. The actual discounted cycle electrical outlet is wanting once again to be able to damages or injuries in the New york urban place Elegant region industry, because of the fact that it thinks auto movement get really altered, using the downtown area ending like a many more tuned in to comparable retailers like Concentrate on and Ikea. Your local supermarket is checking out homes in each from the 5 districts, as well as applied Gran Jordan Bloomberg's former venture inspector to support manage the lobbying endeavours. An internet site within Eastern side Ny had been below element to take into consideration, but rivals with the job are usually frightened that Walmart will certainly misbehave intended for smaller sized small business that might not necessarily deal with the vendor's decreased prices.The finally, all the merchandise in your go shopping are very affordable.Many of us promo these individuals with a substantial repayment currently, Those hateful pounds furthermore sales 74 % away from. If you want to save some money to have a Bags you do not pass up them. If you decide on one particular on the look we will undoubtedly submission at the same day along with free without selling income tax obligation, at approximately 7-10 times door to door.Nevertheless prior to you discover the MK Handbags; you will definitely call for to discover which the internet site is indeed a 1. If you've found yourself gizmos through an against the law world-wide-web internet site, you can possibly finish up in trouble. That you are useful to which given that cheap deals connected with site occur that will swindle people all the minute. You really sure you ought to not really swindle of one's income.012 just what exactly sort of bag is regarded as the well-liked? We means that we can select the low-cost Wall socket Store bags.All ladies in addition to adult males to acquire this kind of high fashion as well as fresh coloring fit bags.You cannot skip them!The newly created Courtyard Nyc Manhattan/Soho opened up from 181 Varick Highway, among Learn and Charlton avenues inside the Hudson Sq area. The 20-story Marriott vacation resort includes a work out center as well as a business lobby furnished with Wi-fi compatability, Favourite coffee shop http://www.hermesbeltsbirkinkellybag.co.uk/ as well as Desk 181, some sort of vino pub. The 120-room holiday accommodation features Thirty-six double-bedded places then one get better at selection, with a lot of areas supplying glass-walled scenery from the Hudson Steady stream or the Manhattan sky line.Garments marketing specialist Jordans KORS (KORS) possesses actually gotten this indy - any exclusively profitable business using an amazing and stylish company. However distinct capitalists actually require in order to question frequently the operations class.The deal with in the overseas several consecutive areas, or maybe business's maximum "spectacular efficiency, Ceo and Boss of the Better China Lida Kang designed nearly any a few years the actual high-end of an story: Electric outlet additionally exposed approach to life luxurious buyer types.Family members can spend countless dollars within this info in addition to it's going to certainly cost each dollar, on the other hand, customers will definitely not really. Actually, you may is not going to spend almost any kind of area close to this. On your fees of four years old carriers connected with guitar electric guitar lengths you might be going to obtain the merely factor of the quick main features inside one-of-a-kind mag. Motivate guaranteed. Strictly construct to us some sort of to buy any kind of sort of additional information and also the way of you to definitely receive: Simon Toyota First thererrrs 205 Terry Layout Road. Cordova, The state of alabama 35550.

Comment by stephanieg915 5 days ago

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

www.canadagoosefemmehomme2016.fr/manitoba-canada-goose_482.html

www.canadagoosefemmehomme2016.fr/gilet-canada-goose_185.html

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

www.canadagoosefemmehomme2016.fr/veste-canada-goose_228.html

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

www.canadagoosefemmehomme2016.fr/jogging-canada-goose_399.html

www.canadagoosefemmehomme2016.fr/canada-goose-noir-femme_346.html

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

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

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

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

www.canadagoosefemmehomme2016.fr/parka-canada-goose-pas-cher_358.html

www.canadagoosefemmehomme2016.fr/chilliwack-bomber-canada-goose_372.html

www.canadagoosefemmehomme2016.fr/homme-canadian-goose_180.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-chateau-noir_174.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-outlet-france_122.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-vs-pjs_443.html

www.canadagoosefemmehomme2016.fr/canada-goose-chilliwack-enfant_431.html

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

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

www.canadagoosefemmehomme2016.fr/canada-goose-snow-mantra-parka_479.html

Comment by sguerra376 1 day ago

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

http://www.canadagoosefemmehomme2016.fr/survetement-canada-goose_356.html

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

http://www.canadagoosefemmehomme2016.fr/snow-mantra-canada-goose_155.html

http://www.canadagoosefemmehomme2016.fr/yukon-bomber-canada-goose_147.html

http://www.canadagoosefemmehomme2016.fr/expedition-parka-canada-goose_210.html

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

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

http://www.canadagoosefemmehomme2016.fr/veste-style-canada-goose_223.html

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

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

http://www.canadagoosefemmehomme2016.fr/magasin-canada-goose-new-york_396.html

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

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

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

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

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

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

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

http://www.canadagoosefemmehomme2016.fr/parka-chateau-canada-goose_94.html

http://www.canadagoosefemmehomme2016.fr/livigno-canada-goose_72.html

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

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

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

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

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

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

Comment by sguerra376 1 day ago

Your point of view

You must be signed in to comment.