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.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.
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

Quick HTML image gallery from folder contents

Terminal - Quick HTML image gallery from folder contents
find . -iname '*.jpg' -exec echo '<img src="{}">' \; > gallery.html
2010-07-03 16:36:15
Functions: echo find
12
Quick HTML image gallery from folder contents

Setting: You have a lot of jpg files in a directory.

Maybe your public_html folder which is readable on the net because of Apache's mod_userdir. All those files from the current folder will be dropped into a file called gallery.html as image tags that can be viewed within a web browser locally or or over the Internet.

Original:

find . -iname "*.jpg" -exec echo "<img src=\"{}\">" >> gallery.html \;

Alternatives

There is 1 alternative - vote for the best!

Terminal - Alternatives
find . -iname '*.jpg' | sed 's/.*/<img src="&">/' > gallery.html
2010-07-04 00:50:32
User: kniht
Functions: find sed
2

My take on the original: even though I like the other's use of -exec echo, sed just feels more natural. This should also be slightly easier to improve.

I expanded this into a script as an exercise, which took about 35 minutes (had to look up some docs): http://bitbucket.org/kniht/nonsense/src/7c1b46488dfc/commandlinefu/quick_image_gallery.py

find . -iname "*.jpg" -printf '<img src="%f" title="%f">\n' > gallery.html
2012-01-04 14:20:21
Functions: find
2

More compact and direct.

find . | perl -wne 'chomp; print qq|<img src="$_" title="$_" /><br />| if /\.(jpg|gif|png)$/;'> gallery.html
2010-07-04 01:43:50
User: spotrick
Functions: find perl
1

This includes a title attribute so you can see the file name by hovering over an image. Also will hoover up any image format - jpg, gif and png.

Know a better way?

If you can do better, submit your command here.

What others think

You need to quote *.jpg or the shell will expand it with undesired results. Inserting the redirection in between the args to find is unusual, did you realize ">> gallery.html" does not apply to each echo?

Cleaning up those issues, plus simplifying quotes and always creating a new file:

find . -iname '*.jpg' -exec echo '<img src="{}">' \; > gallery.html
Comment by kniht 381 weeks and 1 day ago

http://www.michaelkors-handbags.in.net

http://www.canadagoosejacketssale.us.com

http://www.cheapraybans-sunglasses.us.com

http://www.michaelkorsoutletofficials.us.com

http://www.christian-louboutinoutlet.us.org

http://www.christianlouboutin.com.co

http://www.ralphlaurenpoloshirts.me.uk

http://www.lacosteoutlet.us.org

http://www.adidasshoes.us.org

http://www.coachfactoryoutletonlinestores.us.com

http://www.ralph-laurenpolooutlet.us.com

http://www.mont-blancpens.us.com

http://www.michaelkorsoutletclearancee.us.com

http://www.fitflopsaleclearance.us.com

http://www.polooutlet.name

http://www.coachfactoryoutletofficials.us.com

http://www.raybansunglassesformen.us.com

http://www.mbtshoesoutlets.us.com

http://www.oakley-sunglassesoutletonline.us.com

http://www.nikeshoes.com.co

http://www.cheapuggboots.name

http://www.cheapuggboots.org

http://www.raybansun-glasses.com.co

http://www.fredperry.org.uk

http://www.ralphlaurenpolo-uk.org.uk

http://www.valentinooutlet.in.net

http://www.polooutletralphlauren.us.com

http://www.oakleysunglasseswholesaler.us.com

http://www.montblancpensoutlet.com

http://www.ralphlauren-polo.me.uk

http://www.yeezyboost350-v2.us.com

http://www.mcmoutletonline.us

http://raybansunglasses.co-sunglasses.com

http://nikeshoes.nike-com.com

http://www.oakley-sunglassesclearance.us.com

http://www.truereligionjeanss.us.com

http://www.pandoraoutlets.us.com

http://www.montblancpens-outlet.us.com

http://www.lunetterayban.fr

http://www.airjordan4.us

http://www.canadagooseoutlet-store.com.co

http://www.adidasnmd-r1.us.com

http://www.truereligionjeans-sale.us.com

http://www.mlbjerseys.net

http://www.adidasyeezyshoes.name

http://www.poloralphlaurenfactorystore.us.com

http://www.cheapjordans.name

http://www.edhardyclothing.us.com

http://www.michaelkorsoutletclearancehandbags.us.com

http://www.polo-ralphlaurenuk.me.uk

http://www.fitflops-saleclearance.us

http://www.cheapmlb-jerseys.us

http://www.nikeshoesoutlet.us.com

http://polooutlet.amegov.com

http://www.katespadeshandbags.us

http://www.ralphlauren-outletuk.org.uk

http://www.canadagoose.name

http://www.ralph-laurenoutletuk.me.uk

http://www.ralphlaurenoutlets.org.uk

http://www.michaelkorsoutlet-online.in.net

http://www.fredperrypoloshirts.co.uk

http://www.kate-spadeoutlet.us.org

http://www.nike-shoes.us.com

http://www.truereligion-outletstore.us.com

http://www.polo-ralphlauren-pascher.fr

http://www.poloralphlauren-uk.me.uk

http://www.mbtshoescheap.us.com

http://www.pradaoutletstore.us

http://www.pradaoutlet-store.us.com

http://poloralphlauren.amegov.com

http://www.true-religionoutletstore.us.com

http://www.lebron-jamesshoes.us.com

http://www.cheapuggs.name

http://www.michaelkorsoutlet-clearance.org

http://www.oakleysunglasseswholesales.us.com

http://www.michaelkorsoutlet-clearances.us.com

http://adidasyeezyshoes.adidassale.net

http://www.pandorajewelry-outlet.us.com

http://www.katespadeoutlet-store.us.com

http://www.longchampoutlet.us.org

http://www.nikeoutlet.com.co

http://www.oakleysunglasseswholesalee.us.com

http://www.oakleysunglassescheaps.us.com

http://www.fredperryoutlet.us.com

http://www.longchampoutletofficial.us.com

http://www.coachfactory-outlet.eu.com

http://www.adidasoutlet.com.co

http://www.asicsrunningshoes.us.com

http://www.coach-outletonlineclearance.us.com

http://www.christianlouboutin-uk.org.uk

http://www.oakleysunglassesformen.us.com

http://www.nhljerseyss.us.com

http://cheapraybansunglasses.co-sunglasses.com

http://www.coachfactoryoutletmiami.us.com

http://www.coachoutletcoachoutletstore.us.com

http://www.adidasoutlet.us.org

http://www.cheapjordansfor-sale.us.com

http://www.michaelkorsoutletofficial.com

http://www.hermesbeltsoutlet.us.com

http://www.pandoraoutletstore.us.com

http://www.michaelkorsoutlet-clearance.us

http://www.ralphlauren-shirts.org.uk

http://www.ralphlaurenoutletonlinestore.us.com

http://www.ralphlaurenofficial.us.com

http://www.michael-korshandbags.in.net

http://www.michaelkorsoutletonlinestore.us.org

http://www.oakleysunglassesfactory.us.com

http://www.polooutlet.us.org

http://www.raybanssun-glasses.com.co

http://www.coachoutletonlinecoachfactoryoutlets.us.com

http://www.michaelkorssoutletclearance.us.com

http://www.poloralphlauren-uk.org.uk

http://nikeshoes.up-nike.com

http://www.poloralph-laurenuk.co.uk

http://www.michael-korsoutletstore.in.net

http://www.coachfactoryoutlet-coachoutlet.us.com

http://www.canadagoosejacketss.com.co

http://www.christian-louboutinshoes.us

http://www.coach-outletonlinecoachfactoryoutlet.us.com

http://www.cheapnfljerseys.eu.com

http://www.mlbjerseys-wholesale.us.com

http://www.adidasyeezy-shoes.us.com

http://www.nike-shoes.us.org

http://www.valentino-outlet.us.com

http://www.ralph-laurenpolo.us.org

http://www.raybansunglassesonsale90off.us.com

http://www.fitflopssaleclearance.name

http://www.coachoutletcoachfactoryoutlets.us.com

http://www.airjordan.us.org

http://www.canadagoose-outlets.com.co

http://raybansunglassesoutlet.co-sunglasses.com

http://www.uggoutlet.name

http://www.oakleysunglassesss.us.com

http://www.canadagooses.com.co

http://www.ralphlaurenshirts.me.uk

http://www.michaelkorsoutlet-clearance.com

http://www.cheapjordans-forsale.us.com

http://www.oakleysunglasseswholesaleonline.us.com

http://www.coachoutletonlinecoachfactoryoutlet.com.co

http://www.kate-spadeoutletstore.us.com

http://www.nbajerseyss.us.com

http://yeezyboost.adidassale.net

http://www.nikeoutletstorelocations.com

http://www.montblancpenss.com.co

http://www.pandorajewelrycharms.us.com

http://www.mulberryhandbagsuk.co.uk

http://www.hermesbirkins.us.com

http://www.coachoutlet-clearance.us.org

chenlili20170503

Comment by chenyingying 24 weeks and 5 days ago

Pasadena, CA- http://www.huaracherunpas-cher.fr/huarache-vintage_42.html Diabetics will need to pass in http://www.huaracherunpas-cher.fr/huarache-montante_179.html particular good care of his http://www.huaracherunpas-cher.fr/boutique-nike-huarache_151.html or http://www.huaracherunpas-cher.fr/nike-huarache-marron_165.html her toes, states Cesar Lua, one http://www.huaracherunpas-cher.fr/nike-air-huarache-rouge_47.html who owns running shoe lift http://www.huaracherunpas-cher.fr/chaussures-air-huarache_128.html positions keep Novis http://www.huaracherunpas-cher.fr/nike-air-huarache-turquoise_160.html Sneakers. Right here ways that diabetes http://www.huaracherunpas-cher.fr/nike-huarache-beige_91.html patients could look after their http://www.huaracherunpas-cher.fr/nike-air-huarache-blanc_41.html own foot.Inspection: Every day those http://www.huaracherunpas-cher.fr/nike-air-huarache-blanche_153.html that have http://www.huaracherunpas-cher.fr/air-max-huarache_39.html all forms of diabetes must http://www.huaracherunpas-cher.fr/nike-huarache-prix_66.html look at their own toes intended http://www.huaracherunpas-cher.fr/nike-air-huarache-original_144.html for reduces http://www.huaracherunpas-cher.fr/basket-nike-huarache_45.html , sores, inflammation, red areas http://www.huaracherunpas-cher.fr/huarache-usa_100.html or perhaps every fails in http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine_64.html the skin. They will try concerning http://www.huaracherunpas-cher.fr/nike-huarache-jd_46.html their ft as well as http://www.huaracherunpas-cher.fr/nike-huarache-run_72.html the bottoms of http://www.huaracherunpas-cher.fr/nike-air-huarache-bleu_167.html their total foot, having http://www.huaracherunpas-cher.fr/air-huarache-blanc_123.html a mirror if required. 12 http://www.huaracherunpas-cher.fr/nike-huarache-taille_49.html inches incidents can be very http://www.huaracherunpas-cher.fr/nouvelle-nike-huarache_82.html damaging to diabetic http://www.huaracherunpas-cher.fr/nike-huarache-3_108.html patients, thus any kind of damage http://www.huaracherunpas-cher.fr/air-huarache-homme_67.html need to straight away always be checked http://www.huaracherunpas-cher.fr/nike-air-huarache-homme_150.html out http://www.huaracherunpas-cher.fr/nike-air-huarache-safari_73.html by way of a specialized. Clients http://www.huaracherunpas-cher.fr/huarache-nike-chaussures_131.html also needs to http://www.huaracherunpas-cher.fr/chaussure-huarache-nike_173.html look at their particular sneakers to http://www.huaracherunpas-cher.fr/acheter-huarache_84.html remember just about any http://www.huaracherunpas-cher.fr/huarache-noir-et-rose_109.html wear which can http://www.huaracherunpas-cher.fr/nike-huarache-light-ultramarine_171.html cause lesions and abrasions.Care: Clients http://www.huaracherunpas-cher.fr/nike-huarache-blanc_85.html using having diabetes have to http://www.huaracherunpas-cher.fr/nike-huarache-boutique_147.html bathe their particular toes each day and http://www.huaracherunpas-cher.fr/nike-air-huarache-retro_70.html also dried up them http://www.huaracherunpas-cher.fr/nike-huarache-premium_126.html diligently between feet. http://www.huaracherunpas-cher.fr/nike-huarache-fille_148.html Having said that, type http://www.huaracherunpas-cher.fr/air-huarache-solde_40.html two diabetes ft really should not http://www.huaracherunpas-cher.fr/nike-huarache-toute-noir_154.html be confronted http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-rose_58.html with incredibly cold or hot waters. http://www.huaracherunpas-cher.fr/huarache-bordeaux_53.html To keep soft and smooth http://www.huaracherunpas-cher.fr/nike-huarache-2_166.html dermis, make use of type two http://www.huaracherunpas-cher.fr/air-huarache-og_71.html diabetes http://www.huaracherunpas-cher.fr/huarache-og-2017_143.html foot or so lotion every single day within http://www.huaracherunpas-cher.fr/huarache-noir-femme_60.html the surfaces http://www.huaracherunpas-cher.fr/nike-huarache-free-run-2012_146.html and also bottoms on the http://www.huaracherunpas-cher.fr/huarrache-blanche_135.html foot. As they trim toenails, http://www.huaracherunpas-cher.fr/nike-air-huarache-og_162.html patients will have to http://www.huaracherunpas-cher.fr/nike-huarache-light-og_115.html slice right throughout without http://www.huaracherunpas-cher.fr/air-huarache-run_157.html cutting their nails edges. Work with http://www.huaracherunpas-cher.fr/chaussure-air-huarache_180.html a claw record to launch http://www.huaracherunpas-cher.fr/nike-huarache-safari_52.html the edges preventing http://www.huaracherunpas-cher.fr/huarache-acheter_83.html in-grown claws. So that http://www.huaracherunpas-cher.fr/huarache-chaussure_122.html you can manage the flow http://www.huaracherunpas-cher.fr/air-huarache-grise_142.html of blood, people needs to http://www.huaracherunpas-cher.fr/nike-huarache-solde_94.html keep his or http://www.huaracherunpas-cher.fr/chaussures-huarache-nike_152.html her foot elevated as soon as resting. http://www.huaracherunpas-cher.fr/nike-air-huarache-og-retro_101.html They must in addition http://www.huaracherunpas-cher.fr/air-huarache-noir_116.html wriggle their particular http://www.huaracherunpas-cher.fr/nike-huarache-1991_55.html feet plus rotate their own http://www.huaracherunpas-cher.fr/nike-air-huarache-taille_172.html shins everyday to http://www.huaracherunpas-cher.fr/nike-air-huarache-light-pas-cher_44.html have their range of motion. http://www.huaracherunpas-cher.fr/nike-huarache-homme_141.html "People by using diabetes should http://www.huaracherunpas-cher.fr/chaussures-huarache_56.html never go walking all around http://www.huaracherunpas-cher.fr/nike-huarache-agassi_133.html without shoes. Donning boots and shoes as http://www.huaracherunpas-cher.fr/nike-huarache-pour-femme_155.html well as http://www.huaracherunpas-cher.fr/nike-huarache-free-light_134.html clothes helps to http://www.huaracherunpas-cher.fr/air-huarache-nike_87.html protect toes from possible accidents,In paperwork Lua, http://www.huaracherunpas-cher.fr/nike-air-huarache-run-pas-cher_98.html whoever shop makes http://www.huaracherunpas-cher.fr/huarache-bleu_111.html memory foam sneakers.Socks: Stockings which might http://www.huaracherunpas-cher.fr/nike-air-force-1-huarache_113.html be fashioned for diabetes http://www.huaracherunpas-cher.fr/nike-huarache-violet_54.html sufferers are the most http://www.huaracherunpas-cher.fr/huarache-noir_86.html effective to make use http://www.huaracherunpas-cher.fr/nike-huarache-magenta_51.html of. Usually simple, many people prevent http://www.huaracherunpas-cher.fr/huarache-free-run_145.html massaging and make moisture http://www.huaracherunpas-cher.fr/air-huarache-paris_138.html content outside http://www.huaracherunpas-cher.fr/nike-huarache-2013_159.html the feet. Do not use http://www.huaracherunpas-cher.fr/nike-air-huarache-beige_112.html plastic or extend stockings : http://www.huaracherunpas-cher.fr/huarache-light-og_105.html as well as clothes http://www.huaracherunpas-cher.fr/nikeair-huarache_88.html lead with small stretchy or maybe garters.Shoes: http://www.huaracherunpas-cher.fr/nike-huarache-gris_59.html Diabetics must not don http://www.huaracherunpas-cher.fr/nike-huarache_93.html pointy footwear as well http://www.huaracherunpas-cher.fr/nike-air-huarache-run_43.html as high heel shoes. They must get http://www.huaracherunpas-cher.fr/basket-huarache_63.html boots and shoes that http://www.huaracherunpas-cher.fr/air-huarache-femme_90.html has a substantial http://www.huaracherunpas-cher.fr/nike-air-zoom-huarache_89.html and extensive foot container that http://www.huaracherunpas-cher.fr/huarache-nike-blanche_127.html forestalls increased crowding together of http://www.huaracherunpas-cher.fr/nike-air-max-huarache-hybrid_121.html the foot. Any support receiver http://www.huaracherunpas-cher.fr/nike-huarache-run-pas-cher_61.html as well as http://www.huaracherunpas-cher.fr/nike-air-huarache-pas-chere_161.html language will help face shield http://www.huaracherunpas-cher.fr/huarache-instagram_169.html you through abrasions and http://www.huaracherunpas-cher.fr/nike-huarache-usa_114.html chaffing. The sneakers walkfit shoe http://www.huaracherunpas-cher.fr/free-huarache_103.html inserts needs to be http://www.huaracherunpas-cher.fr/nike-huarache-ultramarine_125.html padding and also the external http://www.huaracherunpas-cher.fr/huarache-5_74.html feet needs to http://www.huaracherunpas-cher.fr/huarache-og_183.html be strong as well as http://www.huaracherunpas-cher.fr/nike-air-huarache-1991_65.html extensive. Diabetes sufferers can buy a http://www.huaracherunpas-cher.fr/nike-huarache-leopard_57.html minimum of not one http://www.huaracherunpas-cher.fr/air-flight-huarache_68.html but two twos with acceptable sneakers http://www.huaracherunpas-cher.fr/nike-huarache-rouge_81.html to be able to http://www.huaracherunpas-cher.fr/huarache-nike-pas-cher_79.html don't use exactly http://www.huaracherunpas-cher.fr/nike-air-huarache-international_104.html the same shoes or boots http://www.huaracherunpas-cher.fr/nike-air-huarache-mid_78.html a couple of days repeatedly. Never http://www.huaracherunpas-cher.fr/nike-huarache-paris_69.html wear shoes http://www.huaracherunpas-cher.fr/huarache-noir-et-blanc_96.html or perhaps boots and shoes without http://www.huaracherunpas-cher.fr/nike-huarache-free-run-pas-cher_156.html having footwear."It http://www.huaracherunpas-cher.fr/huarache-nike-noir_149.html is critical to get people suffering from diabetes http://www.huaracherunpas-cher.fr/chaussure-nike-air-huarache_76.html to utilize http://www.huaracherunpas-cher.fr/nike-id-huarache_158.html shoes and boots which fit appropriately http://www.huaracherunpas-cher.fr/huarache-enfant_62.html ,Inches states that http://www.huaracherunpas-cher.fr/huarache-run_132.html Lua, person who owns footwear orthopedic http://www.huaracherunpas-cher.fr/huarache-chaussures_95.html business. "To get the http://www.huaracherunpas-cher.fr/nike-air-huarache-light_168.html most beneficial accommodate, you http://www.huaracherunpas-cher.fr/nike-air-huarache-2_92.html should find a retail store http://www.huaracherunpas-cher.fr/nike-air-flight-huarache-og_48.html masters in http://www.huaracherunpas-cher.fr/huarache-4_118.html orthopaedic boots. They'll know if you'll need accommodative http://www.huaracherunpas-cher.fr/ foot orthotics http://www.huaracherunpas-cher.fr/nike-huarache-femme-pas-cher_140.html , exclusive adjustments, shoes by using http://www.huaracherunpas-cher.fr/nike-huarache-id_164.html lifts and other assortment of running http://www.huaracherunpas-cher.fr/huarache-beige_106.html shoe."About Novis ShoesNovis http://www.huaracherunpas-cher.fr/huarache-leopard_77.html Shoes or boots continues to provide http://www.huaracherunpas-cher.fr/nike-air-huarache-chaussures_80.html memory foam http://www.huaracherunpas-cher.fr/nike-air-flight-huarache_102.html sneakers considering that Early in the http://www.huaracherunpas-cher.fr/huarache-femmes_170.html eightys. Cesar Lua, the actual firms http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-bleu_130.html operator and http://www.huaracherunpas-cher.fr/huarache-light_50.html licensed Pedorthist, continues to http://www.huaracherunpas-cher.fr/air-huarache-light_139.html be generating shoe lifts, custom-made http://www.huaracherunpas-cher.fr/nike-air-force-huarache_124.html shoes, and other goods to get Twenty-eight http://www.huaracherunpas-cher.fr/nike-air-huarache-solde_181.html ages. There're committed http://www.huaracherunpas-cher.fr/huarache-air-max_163.html to adding the http://www.huaracherunpas-cher.fr/nike-air-huarache-prix_120.html clientele very first and providing http://www.huaracherunpas-cher.fr/achat-nike-huarache_137.html these folks the perfect goods and http://www.huaracherunpas-cher.fr/nike-air-huarache-noir_97.html service at the http://www.huaracherunpas-cher.fr/nike-air-huarache-90_110.html very best value.? Next http://www.huaracherunpas-cher.fr/huarache-2017_99.html year Novis Shoes or http://www.huaracherunpas-cher.fr/nike-huarache-chaussures_129.html boots and Master Yahoo. Endorsement to share http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine-og_75.html can be given, http://www.huaracherunpas-cher.fr/nike-air-huarache-run-chaussures_174.html while using the stipulation in which http://www.huaracherunpas-cher.fr/nike-huarache-femmes_182.html Novis Shoes and http://www.huaracherunpas-cher.fr/air-huarache-noire_117.html boots in addition to Expert Bing http://www.huaracherunpas-cher.fr/air-nike-huarache_107.html (an SEO professional player firm) are attributed seeing that main resource. Backlinks to many other websites with this record is strictly forbidden, except for herein imbedded one-way links.

Comment by scott154 7 weeks ago

Your point of view

You must be signed in to comment.