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

Display unique values of a column

Terminal - Display unique values of a column
cut -f 3 | uniq
2012-06-06 10:48:41
User: flxndn
Functions: cut
-3
Display unique values of a column

3 is the column's number.

Alternatives

There are 8 alternatives - vote for the best!

Terminal - Alternatives
awk '{ a[$2]++ } END { for (b in a) { print b } }' file
2012-06-05 07:58:51
User: giorger
Functions: awk
2

Find the unique values of a column utilizing awk.

Credits goes to here (posted by "era"): http://www.unix.com/shell-programming-scripting/77138-awk-print-distinct-col-values.html

cut -d',' -f6 file.csv | sort | uniq
2013-04-10 14:05:32
User: richie
Functions: cut sort
1

the column number is '6'

Know a better way?

If you can do better, submit your command here.

What others think

it does not. you have to add the sort before the uniq.

Comment by cp 280 weeks and 2 days ago

the 'cut -f3 | uniq' pipe will only remove duplicate values that appear sequentially:

a

a

a

b

b

will give

a

b

But

a

a

b

a

b

b

will give

a

b

a

b

Comment by jmsmistral 111 weeks and 6 days 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 4 days ago

http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-bleu_130.html Running shoe insures are http://www.huaracherunpas-cher.fr/huarache-og-2017_143.html definitely the fantastic way of http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-rose_58.html preserving floors and shoes clean http://www.huaracherunpas-cher.fr/nike-huarache-femme-pas-cher_140.html up. Not only http://www.huaracherunpas-cher.fr/huarache-5_74.html companies most of individuals http://www.huaracherunpas-cher.fr/nike-air-huarache-mid_78.html just use these on homes. Footwear http://www.huaracherunpas-cher.fr/huarache-acheter_83.html protects http://www.huaracherunpas-cher.fr/huarache-2017_99.html can also be a fantastic solution http://www.huaracherunpas-cher.fr/huarache-usa_100.html to any company that may http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine-og_75.html be http://www.huaracherunpas-cher.fr/basket-nike-huarache_45.html planning to keep their http://www.huaracherunpas-cher.fr/air-huarache-blanc_123.html floor surfaces, rugs, plus floor cleanse. http://www.huaracherunpas-cher.fr/huarache-leopard_77.html The reason http://www.huaracherunpas-cher.fr/huarache-nike-chaussures_131.html is , the main reason cleanness http://www.huaracherunpas-cher.fr/nike-air-huarache-original_144.html maintains lots of conditions and http://www.huaracherunpas-cher.fr/nike-air-flight-huarache-og_48.html medical problems away. Additionally, http://www.huaracherunpas-cher.fr/huarache-noir_86.html it may assist http://www.huaracherunpas-cher.fr/huarache-chaussure_122.html with attain health and http://www.huaracherunpas-cher.fr/huarrache-blanche_135.html safety criteria along with http://www.huaracherunpas-cher.fr/huarache-4_118.html protect against any kind of http://www.huaracherunpas-cher.fr/nike-air-huarache-2_92.html toxic contamination at the http://www.huaracherunpas-cher.fr/nike-huarache-agassi_133.html place.It can easily http://www.huaracherunpas-cher.fr/air-huarache-og_71.html be positioned across the http://www.huaracherunpas-cher.fr/basket-huarache_63.html sneakers often by simply hands http://www.huaracherunpas-cher.fr/nike-air-huarache-noir_97.html or perhaps http://www.huaracherunpas-cher.fr/nike-air-huarache-international_104.html which has a sneaker shelling http://www.huaracherunpas-cher.fr/nike-air-flight-huarache_102.html out systems. Actually, http://www.huaracherunpas-cher.fr/chaussure-huarache-nike_173.html this particular dispenser is really http://www.huaracherunpas-cher.fr/air-huarache-grise_142.html a smaller product that http://www.huaracherunpas-cher.fr/air-huarache-nike_87.html will sits on http://www.huaracherunpas-cher.fr/huarache-air-max_163.html the floor. On dwellings, http://www.huaracherunpas-cher.fr/chaussures-huarache-nike_152.html footwear insures offer complete protection http://www.huaracherunpas-cher.fr/nike-air-huarache-light_168.html from dust, drinking water http://www.huaracherunpas-cher.fr/nike-huarache-marron_165.html , will get, as well http://www.huaracherunpas-cher.fr/nike-air-huarache-run_43.html as debris along with industries http://www.huaracherunpas-cher.fr/huarache-light_50.html they're employed for number http://www.huaracherunpas-cher.fr/nike-air-huarache-taille_172.html of purposes dependant http://www.huaracherunpas-cher.fr/nike-huarache-blanc_85.html on the of http://www.huaracherunpas-cher.fr/huarache-og_183.html computer. All these includes utilized throughout health-related http://www.huaracherunpas-cher.fr/nike-huarache-usa_114.html , engineering, electric business.All http://www.huaracherunpas-cher.fr/nike-huarache-free-run-2012_146.html these industries never take advantage http://www.huaracherunpas-cher.fr/huarache-light-og_105.html of the exact shoes http://www.huaracherunpas-cher.fr/nike-huarache_93.html addresses. Why the http://www.huaracherunpas-cher.fr/nike-air-huarache-bleu_167.html visible difference will http://www.huaracherunpas-cher.fr/nike-huarache-leopard_57.html be the sort of live materials http://www.huaracherunpas-cher.fr/nike-huarache-run_72.html within the http://www.huaracherunpas-cher.fr/nike-air-huarache-safari_73.html creation of those addresses. To the http://www.huaracherunpas-cher.fr/nike-huarache-1991_55.html ease of shoppers disposable http://www.huaracherunpas-cher.fr/huarache-bordeaux_53.html boot includes can also http://www.huaracherunpas-cher.fr/nike-huarache-toute-noir_154.html be found now-a-days. http://www.huaracherunpas-cher.fr/nike-huarache-rouge_81.html Non reusable signifies http://www.huaracherunpas-cher.fr/nike-huarache-ultramarine_125.html you cannot wear them http://www.huaracherunpas-cher.fr/nike-huarache-2_166.html once more as http://www.huaracherunpas-cher.fr/nike-huarache-jd_46.html they are manufactured to be http://www.huaracherunpas-cher.fr/nike-huarache-light-og_115.html used along with pitch objective. http://www.huaracherunpas-cher.fr/nike-huarache-femmes_182.html They're constructed from lumination content http://www.huaracherunpas-cher.fr/huarache-beige_106.html such as http://www.huaracherunpas-cher.fr/nike-huarache-gris_59.html plastic sheets and http://www.huaracherunpas-cher.fr/nike-huarache-prix_66.html also please don't happen considerably http://www.huaracherunpas-cher.fr/huarache-free-run_145.html price. Moreover vinyl, http://www.huaracherunpas-cher.fr/huarache-instagram_169.html cardstock, as well as silicone includes are http://www.huaracherunpas-cher.fr/chaussure-nike-air-huarache_76.html obtainable. You can http://www.huaracherunpas-cher.fr/huarache-nike-blanche_127.html choose the actual http://www.huaracherunpas-cher.fr/nike-huarache-taille_49.html substance which fits properly to your http://www.huaracherunpas-cher.fr/nike-air-huarache-run-pas-cher_98.html demands.With the advancement within http://www.huaracherunpas-cher.fr/nike-air-huarache-og-retro_101.html technological innovation, nowadays http://www.huaracherunpas-cher.fr/air-huarache-light_139.html we have ESD http://www.huaracherunpas-cher.fr/huarache-chaussures_95.html sneakers which can be worn out http://www.huaracherunpas-cher.fr/nike-air-force-1-huarache_113.html from the authorities dealing http://www.huaracherunpas-cher.fr/nike-huarache-2013_159.html with http://www.huaracherunpas-cher.fr/air-flight-huarache_68.html electronic systems, gadgets, and also http://www.huaracherunpas-cher.fr/nike-air-huarache-solde_181.html circuits. This is due http://www.huaracherunpas-cher.fr/nike-air-max-huarache-hybrid_121.html to the reason why http://www.huaracherunpas-cher.fr/huarache-enfant_62.html they have higher possibilities of http://www.huaracherunpas-cher.fr/nike-air-huarache-turquoise_160.html electrical bangs in addition to http://www.huaracherunpas-cher.fr/nike-huarache-fille_148.html spikes. These kinds of http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine_64.html ESD shoes and http://www.huaracherunpas-cher.fr/nikeair-huarache_88.html boots secure these folks when http://www.huaracherunpas-cher.fr/huarache-femmes_170.html they take care http://www.huaracherunpas-cher.fr/nike-air-huarache-1991_65.html of this sort of http://www.huaracherunpas-cher.fr/nike-air-huarache-light-pas-cher_44.html sensitive electric equipments http://www.huaracherunpas-cher.fr/nike-air-huarache-retro_70.html along with construct. This http://www.huaracherunpas-cher.fr/nike-huarache-pour-femme_155.html type of shoes or boots http://www.huaracherunpas-cher.fr/air-huarache-run_157.html when its on-state repellent price http://www.huaracherunpas-cher.fr/nike-air-huarache-blanc_41.html can be between Six.5X105 http://www.huaracherunpas-cher.fr/nike-huarache-violet_54.html a few.5X107 are called http://www.huaracherunpas-cher.fr/nike-huarache-id_164.html ESD shoes http://www.huaracherunpas-cher.fr/huarache-nike-noir_149.html or boots.These will also be accustomed http://www.huaracherunpas-cher.fr/air-huarache-femme_90.html to safeguard all of http://www.huaracherunpas-cher.fr/nike-huarache-safari_52.html us through fixed http://www.huaracherunpas-cher.fr/nike-huarache-3_108.html power jolts that many http://www.huaracherunpas-cher.fr/nike-id-huarache_158.html of us receive http://www.huaracherunpas-cher.fr/nike-huarache-run-pas-cher_61.html in some cases even though going http://www.huaracherunpas-cher.fr/air-huarache-homme_67.html for walks across http://www.huaracherunpas-cher.fr/nike-air-huarache-prix_120.html a carpet over a wetter http://www.huaracherunpas-cher.fr/air-nike-huarache_107.html and http://www.huaracherunpas-cher.fr/nike-air-huarache-og_162.html also day you need it. This specific http://www.huaracherunpas-cher.fr/huarache-bleu_111.html static electrical power is http://www.huaracherunpas-cher.fr/nike-huarache-solde_94.html really a http://www.huaracherunpas-cher.fr/nike-air-huarache-pas-chere_161.html stainless steel ask for http://www.huaracherunpas-cher.fr/nike-air-force-huarache_124.html due to imbalance connected http://www.huaracherunpas-cher.fr/nike-air-huarache-blanche_153.html with electrons at first glance of http://www.huaracherunpas-cher.fr/achat-nike-huarache_137.html cloth. ESD sneaker features http://www.huaracherunpas-cher.fr/nike-huarache-beige_91.html greater regular when compared http://www.huaracherunpas-cher.fr/air-huarache-noire_117.html with normal http://www.huaracherunpas-cher.fr/nouvelle-nike-huarache_82.html antistatic footwear.Factors impacting on the sneakers http://www.huaracherunpas-cher.fr/air-max-huarache_39.html will be motion speed, http://www.huaracherunpas-cher.fr/nike-huarache-homme_141.html pollution degree, wetness http://www.huaracherunpas-cher.fr/nike-air-huarache-90_110.html from the ambiance, technique http://www.huaracherunpas-cher.fr/nike-huarache-free-light_134.html for coming in contact with http://www.huaracherunpas-cher.fr/nike-huarache-boutique_147.html , yet others. http://www.huaracherunpas-cher.fr/huarache-vintage_42.html They're included in electronics http://www.huaracherunpas-cher.fr/huarache-noir-femme_60.html companies in which you http://www.huaracherunpas-cher.fr/ have to handle the particular http://www.huaracherunpas-cher.fr/chaussures-air-huarache_128.html build and various machinery.The smartest http://www.huaracherunpas-cher.fr/nike-huarache-premium_126.html thing is that http://www.huaracherunpas-cher.fr/nike-air-huarache-beige_112.html you can also http://www.huaracherunpas-cher.fr/boutique-nike-huarache_151.html purchase a copy ESD footwear http://www.huaracherunpas-cher.fr/nike-air-huarache-run-chaussures_174.html on the internet, because there http://www.huaracherunpas-cher.fr/acheter-huarache_84.html are enough http://www.huaracherunpas-cher.fr/huarache-noir-et-blanc_96.html regarding manufacturers who've made http://www.huaracherunpas-cher.fr/chaussure-air-huarache_180.html its extensive online presence http://www.huaracherunpas-cher.fr/chaussures-huarache_56.html regarding offering top http://www.huaracherunpas-cher.fr/nike-air-huarache-chaussures_80.html quality array of ESD shoes http://www.huaracherunpas-cher.fr/nike-huarache-paris_69.html as well as zero static http://www.huaracherunpas-cher.fr/huarache-noir-et-rose_109.html mitts with remarkably reduced price http://www.huaracherunpas-cher.fr/nike-huarache-free-run-pas-cher_156.html selection. Getting on http://www.huaracherunpas-cher.fr/free-huarache_103.html the internet could as http://www.huaracherunpas-cher.fr/nike-huarache-chaussures_129.html well provide help to look http://www.huaracherunpas-cher.fr/nike-air-huarache-rouge_47.html at and compare the http://www.huaracherunpas-cher.fr/air-huarache-solde_40.html money necessary for this http://www.huaracherunpas-cher.fr/nike-air-huarache-homme_150.html system made available http://www.huaracherunpas-cher.fr/nike-huarache-light-ultramarine_171.html from diverse suppliers.In addition http://www.huaracherunpas-cher.fr/nike-huarache-magenta_51.html for the following, you http://www.huaracherunpas-cher.fr/huarache-run_132.html can also visit many http://www.huaracherunpas-cher.fr/nike-air-zoom-huarache_89.html of the b2b http://www.huaracherunpas-cher.fr/air-huarache-paris_138.html web sites that may http://www.huaracherunpas-cher.fr/air-huarache-noir_116.html will give you a directory http://www.huaracherunpas-cher.fr/huarache-nike-pas-cher_79.html of all of http://www.huaracherunpas-cher.fr/huarache-montante_179.html the reputed distributors. And so, just what are people watching for! Choose most of these ESD sneakers and make certain ones safety.

Comment by scott154 6 weeks and 5 days ago

Your point of view

You must be signed in to comment.