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

Join the content of a bash array with commas

Terminal - Join the content of a bash array with commas
printf "%s," "${LIST[@]}" | cut -d "," -f 1-${#LIST[@]}
2012-06-04 14:56:12
User: Valise
Functions: cut printf
0
Join the content of a bash array with commas

printf reapeats the format as longer as it has arguments. Then the idea is to make cut retain as much fields as we have elements in the array.

As usual with such join/split string manipulation, you have to make sure you don't have conflicts between your separator and your array content.

Alternatives

There are 7 alternatives - vote for the best!

Terminal - Alternatives
(IFS=,; echo "${array[*]}")
2013-09-25 10:36:38
User: aspiers
Functions: echo
2

This type of join is clearly documented in the bash manual. Only the first character of IFS is used for the delimiter.

printf -- " -e %s" ${ARRAY[*]}
2014-02-25 03:34:12
User: SEJeff
Functions: printf
1
DOCKER_APP_VARS=(DATABASE_USER=dbuserro, DATABASE_PASSWORD=maipass)

[[email protected] container] (master)$ echo docker run $(printf -- " -e %s" ${DOCKER_APP_VARS[*]}) -name 12factorapp mattdm/fedora-small

docker run -e DATABASE_USER=dbuserro, -e DATABASE_PASSWORD=maipass -name 12factorapp mattdm/fedora-small

Note that the printf method by itsself doesn't include a newline (\n), so you'll need to embed it into an echo statement or something that does.

Know a better way?

If you can do better, submit your command here.

What others think

With The early 90's, Gianni Versace produced a nominal edition assortment of jewellery timepieces, deriving through effort between your well-known designer Franck Muller, of which designed in addition to generated the gathering with Geneva. Versace is actually symbolic of beauty, school and a spotlight to a particular, and that is demonstrated in their enjoy collection.Through various flip side, this won't happen by using an instant. This particular must move in a manner where you continuously detest for you to rounded down whatever you hate regardless if one are inside a web page link. Nonetheless as fast after you found to consider satisfaction inside, almost everything will adapt. Details will show up brighter and with regards to each inspire would seem clear-cut like a approach to start.Now which Handbags Wall socket Assets offers actually announced their own sign up with all the Investments as well as Swap Compensation, this Initial public offering motive is definitely standard. Morgan Stanley, JP Morgan Follow in addition to Goldman Sachs definitely will end up being handling the http://www.hermesbeltsbirkinkellybag.co.uk/ Dpo.In the particular Ough.S., sales tax is a great deal far more shifty. No search till you are waiting on the have a look at when it is basically combined with the purchase price."Michael Kors is surely an natural and organic addition for Bleecker Neighborhood and all Bleecker frequenters will probably be excited to see your creator and also reality tv persona right here. We percieve your man every now and then within the area so that it makes common sense ..." states Glenda, a local homeowner.Initially beginning from their own attire series, he or she rapidly became any name to help think in the manner business. Many of the significant store attire sites globally starting outfitting the clothes collection for women therefore his / her reputation enhanced. Girls all over the world adored the particular means his / her clothes could match their body as well as easily he / she enhanced an admirer groundwork which contains a portion of the finest megastars world-wide.The most in-demand babies Timex examines are the Timex Kidz Moment Instructor Flowers T89022, Kidz Dinosaurs T7B121, Qa New Greyish Rapid Put Band T71291, Kidz Hide T78141, Kidz Disguised . Picture Rockets T75041, Kidz T. Mentor Crimson Goof T7B581, Kidz Capital t. Tutor Glowing blue Tractor T7B611, Kidz Various colored Pockets T7B051, Kidz Pink Blue Flowers T74951, as well as the Kidz Martial artist Airplanes T79681.The parent receiving many dominant honors together with his job offering, amid quite a lot of people, Developer of the Several years, Creator of the year, Womenswear Custom of this year as well as Men's clothing Custom of the Twelve months. They are and also the youngest receiver to obtain the Geoffrey Beene Lifetime Success Honor from the CFDA.

Comment by stephanieg915 6 days ago

By way of giving handbags in complete purchase time frame, anybody can gain huge amount of profit from that. It is stated to be the smart choice whereby your wholesale suppliers are generating huge amount of profit from that. Oahu is the very best enterprise that is depending on brand new trends. It's going to undoubtedly be the correct solution if you are having component of promoting handbags about low cost basis. It's the best method of having into style market. While using quickly altering fashion trends, this specific are not able to stick with outdated or even existing craze. It keeps on modifying and it'll adjust using the passage of time. These kinds of from suppliers handbags are available in various patterns and also forms which can be reportedly definitely very well liked and helps a person in developing your organization in style marketplace. If you want for being handbags wholesale suppliers, this can probably be said because best brand out there. You will find large number of handbags which is either this is to acquire or perhaps purchase, you can definitely become to be a handbag importer. If you need to be a low cost handbag, there is certainly specified kind of stuff that your stores may demand from you.If an individual wholesale handbag, there are several sorts of points that the actual suppliers may well surely requirement within you. The most crucial aspect in ecommerce is actually you are going to supply these types of vogue handbags, then you should allow it to become without doubt you might provide the delivery in time. Your retailer has to be capable so they can believe in you actually. For that reason, really it is very important you should escort a group that may be depended in order to meet the output deadlines promptly. Thus, the handbag importer will come in current market by means of acknowledging the fact provider may want to fail you at some point. For an importer, it's very very easy to come to be handbags suppliers. Is generally considerably it's that one could get all your profits when you will not need to discuss your earnings together with just about any finally particular person. A middleman regarding handbags would be the an individual that is actually well established in vogue marketplace that's essentially associated with latest pattern of favor. In ecommerce, the handbags merchants mostly works as a vehicle through your pet all the is actually ended through the stores conclude who's specifically working with this product client in order http://www.hermesbeltsbirkinkellybag.co.uk/ to manufacturer. It might be claimed as the immediate getting organization its keep isn't finally individual that will need discuss from the income. This is actually the very best and many well-known company in recent times.

Comment by stephanieg915 6 days ago

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

http://www.canadagoosefemmehomme2016.fr/fr-canada-goose_182.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/boutique-canada-goose_378.html

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-victoria-parka_462.html

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-occasion-femme_282.html

http://www.canadagoosefemmehomme2016.fr/boutique-en-ligne-canada-goose_131.html

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

http://www.canadagoosefemmehomme2016.fr/acheter-canada-goose-paris_406.html

http://www.canadagoosefemmehomme2016.fr/parka-canada-goose_120.html

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

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

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

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

http://www.canadagoosefemmehomme2016.fr/manteau-hiver-canada-goose_480.html

http://www.canadagoosefemmehomme2016.fr/nouvelle-canada-goose_193.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canadian-goose_205.html

Comment by sguerra376 4 days ago

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

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

www.canadagoosefemmehomme2016.fr/canada-goose-occasion-femme_282.html

www.canadagoosefemmehomme2016.fr/canada-goose-veste-femme_363.html

www.canadagoosefemmehomme2016.fr/usine-canada-goose_85.html

www.canadagoosefemmehomme2016.fr/canada-goose-taille-grand-ou-petit_112.html

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

www.canadagoosefemmehomme2016.fr/doudoune-homme-canada-goose-pas-cher_204.html

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

www.canadagoosefemmehomme2016.fr/prix-d-une-canada-goose_130.html

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

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

www.canadagoosefemmehomme2016.fr/canada-goose-france-boutique_218.html

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

www.canadagoosefemmehomme2016.fr/rideau-canada-goose_303.html

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

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

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-pas-cher_192.html

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

www.canadagoosefemmehomme2016.fr/canada-goose-snow-mantra_209.html

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

www.canadagoosefemmehomme2016.fr/doudoune-canada-goose-montebello-femme_128.html

www.canadagoosefemmehomme2016.fr/blouson-canada-goose-homme_467.html

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

Comment by sguerra376 4 days ago

www.canadagoosefemmehomme2016.fr/fourrure-canada-goose_70.html

www.canadagoosefemmehomme2016.fr

www.canadagoosefemmehomme2016.fr/yorkville-canada-goose_463.html

www.canadagoosefemmehomme2016.fr/ou-acheter-canada-goose_100.html

www.canadagoosefemmehomme2016.fr/ou-trouver-canada-goose_232.html

www.canadagoosefemmehomme2016.fr/achat-canada-goose-en-ligne_153.html

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

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

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

www.canadagoosefemmehomme2016.fr/acheter-canada-goose-paris_406.html

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

www.canadagoosefemmehomme2016.fr/manteau-comme-canada-goose_226.html

www.canadagoosefemmehomme2016.fr/manteau-type-canada-goose_369.html

www.canadagoosefemmehomme2016.fr/magasin-canada-goose-paris_39.html

www.canadagoosefemmehomme2016.fr/canada-goose-doudoune-sans-manche_166.html

www.canadagoosefemmehomme2016.fr/manteau-canada-goose-femme-prix_422.html

www.canadagoosefemmehomme2016.fr/canada-goose-sans-fourrure_311.html

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

www.canadagoosefemmehomme2016.fr/victoria-parka-canada-goose_338.html

www.canadagoosefemmehomme2016.fr/magasin-canada-goose-france_216.html

www.canadagoosefemmehomme2016.fr/veste-canada-goose-femmes_189.html

www.canadagoosefemmehomme2016.fr/veste-canada-goose-femme_274.html

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

Comment by sguerra376 3 days ago

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

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

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-bleu-marine_235.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-taille-s_327.html

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

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

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

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

http://www.canadagoosefemmehomme2016.fr/canada-goose-point-de-vente_371.html

http://www.canadagoosefemmehomme2016.fr/magasin-d-usine-canada-goose_331.html

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

http://www.canadagoosefemmehomme2016.fr/kensington-parka-canada-goose_257.html

http://www.canadagoosefemmehomme2016.fr/canada-goose-mystique-femme_179.html

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

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

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

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

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

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

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

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

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

http://www.canadagoosefemmehomme2016.fr/homme-canada-goose_350.html

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

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

Comment by sguerra376 1 day ago

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

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

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

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

http://www.canadagoosefemmehomme2016.fr/veste-canada-goose-femme-pas-chere_357.html

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

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

http://www.canadagoosefemmehomme2016.fr/parka-homme-canada-goose_84.html

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

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

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

http://www.canadagoosefemmehomme2016.fr/mystique-parka-canada-goose_229.html

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

http://www.canadagoosefemmehomme2016.fr/ou-acheter-canada-goose_100.html

http://www.canadagoosefemmehomme2016.fr/doudoune-canadian-goose_205.html

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

http://www.canadagoosefemmehomme2016.fr/manteau-comme-canada-goose_226.html

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

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

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

Comment by sguerra376 1 day ago

Your point of view

You must be signed in to comment.