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

Google Translate

Terminal - Google Translate
wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=translation+example&sl=auto&tl=fr" | sed 's/\[\[\[\"//' | cut -d \" -f 1
2011-03-06 13:46:16
User: sairon
Functions: cut sed wget
5
Google Translate

substitute "example" with desired string;

tl = target language (en, fr, de, hu, ...);

you can leave sl parameter as-is (autodetection works fine)

Alternatives

There are 3 alternatives - vote for the best!

Terminal - Alternatives
translate(){ wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; }
2010-03-08 03:15:48
User: matthewbauer
Functions: sed wget
65

Usage:

translate <phrase> <source-language> <output-language>

Example:

translate hello en es

See this for a list of language codes:

http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes

translate() { lng1="$1";lng2="$2";shift;shift; wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=${@// /+}&langpair=$lng1|$lng2" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; }
2010-05-02 22:15:30
User: bandie91
Functions: sed wget
8

allow multiword translations

cmd=$( wget -qO- "http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&q=$1&langpair=$2|${3:-en}" | sed 's/.*"translatedText":"\([^"]*\)".*}/\1\n/'; ); echo "$cmd"
2010-03-13 01:09:00
User: dtolj
Functions: sed wget
2
translate <phrase> <source-language> <output-language>

works from command line

curl -s -A "Mozilla" "http://translate.google.com.br/translate_a/t?client=t&text=Hi+world&hl=pt-BR&sl=en&tl=pt&multires=1&ssel=0&tsel=0&sc=1" | awk -F'"' '{print $2}'
2011-07-03 00:11:52
User: gean01
Functions: awk
1

Translates a string from English to Portuguese by using google translator web service.

translate(){wget -U "Mozilla/5.0" -qO - "https://translate.google.com/translate_a/single?client=t&sl=${3:-auto}&tl=${2:-en}&dt=t&q=$1" | cut -d'"' -f2}
2014-06-10 12:08:51
User: klisanor
Functions: cut
1
translate <some phrase> [output-language] [source-language]

1) "some phrase" should be in quotes

2) [output-language] - optional (default: English)

3) [source-language] - optional (default: auto)

translate "bonjour petit lapin"

hello little rabbit

translate "bonjour petit lapin" en

hello little rabbit

translate "bonjour petit lapin" en fr

hello little rabbit

Know a better way?

If you can do better, submit your command here.

What others think

http://www.huaracherunpas-cher.fr/nike-air-huarache-solde_181.html Shoe buy contains the http://www.huaracherunpas-cher.fr/nike-air-huarache-rouge_47.html largest selection of http://www.huaracherunpas-cher.fr/chaussures-air-huarache_128.html ladies shoes, mens http://www.huaracherunpas-cher.fr/chaussure-air-huarache_180.html shoes, kid's shoes, laid-back http://www.huaracherunpas-cher.fr/nike-huarache-pour-femme_155.html shoes http://www.huaracherunpas-cher.fr/free-huarache_103.html , outfit shoes, as well as http://www.huaracherunpas-cher.fr/huarache-vintage_42.html athletic shoes. http://www.huaracherunpas-cher.fr/air-huarache-noir_116.html Pick from http://www.huaracherunpas-cher.fr/huarache-chaussures_95.html more than One particular http://www.huaracherunpas-cher.fr/nike-air-huarache-og_162.html ,050 brand http://www.huaracherunpas-cher.fr/huarache-noir-et-rose_109.html names, One,000, http://www.huaracherunpas-cher.fr/huarache-noir_86.html 000 merchandise, one of the http://www.huaracherunpas-cher.fr/air-huarache-run_157.html most types for http://www.huaracherunpas-cher.fr/air-huarache-noire_117.html each http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine-og_75.html manufacturer, by far the most http://www.huaracherunpas-cher.fr/nike-air-huarache-retro_70.html up-to-date clothing http://www.huaracherunpas-cher.fr/nike-air-huarache-original_144.html , along with http://www.huaracherunpas-cher.fr/nike-air-huarache-international_104.html the broadest variety of http://www.huaracherunpas-cher.fr/nike-air-huarache-turquoise_160.html supplies, colors, dimensions, http://www.huaracherunpas-cher.fr/nike-air-zoom-huarache_89.html and also dimensions. As http://www.huaracherunpas-cher.fr/nike-huarache-3_108.html well as http://www.huaracherunpas-cher.fr/huarache-bordeaux_53.html , searching for http://www.huaracherunpas-cher.fr/nike-air-huarache-og-retro_101.html shoes on Shoebuy is definitely http://www.huaracherunpas-cher.fr/huarache-noir-femme_60.html Risk-Free. Enjoy http://www.huaracherunpas-cher.fr/huarache-nike-pas-cher_79.html Free Shipping and also http://www.huaracherunpas-cher.fr/nike-huarache-taille_49.html No http://www.huaracherunpas-cher.fr/nike-huarache-run_72.html cost Returning Shipment in You.Utes. http://www.huaracherunpas-cher.fr/nike-huarache-jd_46.html requests. In http://www.huaracherunpas-cher.fr/huarache-og_183.html addition, a new 100% http://www.huaracherunpas-cher.fr/air-huarache-og_71.html Value Guarantee http://www.huaracherunpas-cher.fr/huarache-femmes_170.html plus a http://www.huaracherunpas-cher.fr/nike-huarache-safari_52.html 100% Secure Obtain Assurance upon http://www.huaracherunpas-cher.fr/huarache-instagram_169.html each http://www.huaracherunpas-cher.fr/air-huarache-solde_40.html and every buy. http://www.huaracherunpas-cher.fr/huarache-noir-et-blanc_96.html Shoebuy could be the http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine_64.html one-stop go shopping http://www.huaracherunpas-cher.fr/nike-air-huarache-chaussures_80.html for your http://www.huaracherunpas-cher.fr/nike-air-huarache-blanc_41.html entire boots needs.When a person http://www.huaracherunpas-cher.fr/nike-huarache-premium_126.html join the Shoebuy.net http://www.huaracherunpas-cher.fr/nike-huarache-leopard_57.html internet site, http://www.huaracherunpas-cher.fr/huarache-acheter_83.html you will http://www.huaracherunpas-cher.fr/nike-huarache-light-og_115.html get unique fellow member benefits. http://www.huaracherunpas-cher.fr/nike-huarache-prix_66.html New member http://www.huaracherunpas-cher.fr/air-max-huarache_39.html benefits include things like:Automatically http://www.huaracherunpas-cher.fr/acheter-huarache_84.html get 10% off http://www.huaracherunpas-cher.fr/huarache-4_118.html of http://www.huaracherunpas-cher.fr/nike-huarache-femmes_182.html your first purchase! Whenever http://www.huaracherunpas-cher.fr/huarrache-blanche_135.html you log in during http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-bleu_130.html the browse approach http://www.huaracherunpas-cher.fr/nike-air-huarache-run_43.html , Shoebuy.web realises http://www.huaracherunpas-cher.fr/huarache-light_50.html that you http://www.huaracherunpas-cher.fr/air-huarache-nike_87.html are a first-time purchaser as http://www.huaracherunpas-cher.fr/nike-huarache-free-light_134.html well http://www.huaracherunpas-cher.fr/nike-air-huarache-homme_150.html as 10% is http://www.huaracherunpas-cher.fr/chaussures-huarache-nike_152.html actually immediately taken off out http://www.huaracherunpas-cher.fr/nike-huarache-free-run-pas-cher_156.html of http://www.huaracherunpas-cher.fr/boutique-nike-huarache_151.html your buy.Get cost-free electronic mail http://www.huaracherunpas-cher.fr/nike-air-force-huarache_124.html up-dates about new http://www.huaracherunpas-cher.fr/huarache-nike-noir_149.html products and also http://www.huaracherunpas-cher.fr/nike-huarache-free-run-2012_146.html deals.Automatically http://www.huaracherunpas-cher.fr/nike-huarache-paris_69.html become part of the Regular http://www.huaracherunpas-cher.fr/nike-air-huarache-bleu_167.html Consumer http://www.huaracherunpas-cher.fr/nike-huarache-chaussures_129.html Program, which in http://www.huaracherunpas-cher.fr/nouvelle-nike-huarache_82.html turn saves you 10% about http://www.huaracherunpas-cher.fr/nike-huarache-fille_148.html virtually any obtain http://www.huaracherunpas-cher.fr/nike-huarache-beige_91.html you make http://www.huaracherunpas-cher.fr/huarache-bleu_111.html inside Two months of http://www.huaracherunpas-cher.fr/nike-huarache-boutique_147.html your prior just http://www.huaracherunpas-cher.fr/basket-huarache_63.html one! Every http://www.huaracherunpas-cher.fr/air-huarache-homme_67.html time you http://www.huaracherunpas-cher.fr/nike-huarache-gris_59.html sign in in the http://www.huaracherunpas-cher.fr/air-huarache-grise_142.html see procedure, http://www.huaracherunpas-cher.fr/huarache-free-run_145.html Shoebuy.com confirms your night out http://www.huaracherunpas-cher.fr/air-huarache-blanc_123.html anyone recently made http://www.huaracherunpas-cher.fr/chaussures-huarache_56.html a purchase, of http://www.huaracherunpas-cher.fr/nike-air-huarache-light-pas-cher_44.html course, if http://www.huaracherunpas-cher.fr/nike-huarache-light-ultramarine_171.html it's in 2 months, http://www.huaracherunpas-cher.fr/nike-huarache-solde_94.html 10% http://www.huaracherunpas-cher.fr/nike-huarache-toute-noir_154.html can be automatically deduced from http://www.huaracherunpas-cher.fr/air-huarache-light_139.html the buy.So, delight http://www.huaracherunpas-cher.fr/nike-huarache-magenta_51.html in more http://www.huaracherunpas-cher.fr/huarache-chaussure_122.html than One,050 models http://www.huaracherunpas-cher.fr/huarache-nike-chaussures_131.html in addition http://www.huaracherunpas-cher.fr/huarache-montante_179.html to One particular http://www.huaracherunpas-cher.fr/huarache-5_74.html ,500,000 solutions http://www.huaracherunpas-cher.fr/huarache-run_132.html , Totally free http://www.huaracherunpas-cher.fr/nike-air-huarache-beige_112.html about Oughout.Azines. orders, Free http://www.huaracherunpas-cher.fr/nike-air-huarache-safari_73.html of charge Give back http://www.huaracherunpas-cher.fr/huarache-leopard_77.html Shipping and http://www.huaracherunpas-cher.fr/nike-air-max-huarache-hybrid_121.html delivery on http://www.huaracherunpas-cher.fr/nike-air-huarache-90_110.html Oughout.Ersus. requests, as well as http://www.huaracherunpas-cher.fr/nike-air-huarache-prix_120.html unique http://www.huaracherunpas-cher.fr/air-huarache-femme_90.html participant rewards. Each http://www.huaracherunpas-cher.fr/huarache-air-max_163.html and every obtain, Shoebuy will http://www.huaracherunpas-cher.fr/nike-air-huarache-taille_172.html be donations $1.Double http://www.huaracherunpas-cher.fr/huarache-2017_99.html zero http://www.huaracherunpas-cher.fr/nike-air-huarache-light_168.html for the Residence with regard http://www.huaracherunpas-cher.fr/nike-huarache-2_166.html to Minor http://www.huaracherunpas-cher.fr/nike-huarache-1991_55.html Wanderers, having a certain http://www.huaracherunpas-cher.fr/nike-huarache-id_164.html at http://www.huaracherunpas-cher.fr/nike-huarache-violet_54.html least $5,500 http://www.huaracherunpas-cher.fr/nike-air-huarache-1991_65.html contributing to at all http://www.huaracherunpas-cher.fr/huarache-beige_106.html times . a http://www.huaracherunpas-cher.fr/nike-air-huarache-2_92.html minimum of $15,1000 http://www.huaracherunpas-cher.fr/nike-huarache-run-pas-cher_61.html in excess http://www.huaracherunpas-cher.fr/nike-huarache-blanc_85.html of Three days around Several http://www.huaracherunpas-cher.fr/nike-huarache-usa_114.html different not for http://www.huaracherunpas-cher.fr/nike-air-huarache-run-chaussures_174.html profit companies.The http://www.huaracherunpas-cher.fr/nike-huarache-agassi_133.html Home with regard http://www.huaracherunpas-cher.fr/air-huarache-paris_138.html to Very http://www.huaracherunpas-cher.fr/nike-huarache-marron_165.html little Wanderers is http://www.huaracherunpas-cher.fr/nikeair-huarache_88.html a nationwide renowned, non-public, non-profit http://www.huaracherunpas-cher.fr/nike-huarache-2013_159.html baby http://www.huaracherunpas-cher.fr/chaussure-huarache-nike_173.html as well as http://www.huaracherunpas-cher.fr/nike-huarache-femme-pas-cher_140.html family members service company. http://www.huaracherunpas-cher.fr/nike-air-huarache-noir_97.html It's been the main http://www.huaracherunpas-cher.fr/chaussure-nike-air-huarache_76.html Boston landscaping http://www.huaracherunpas-cher.fr/air-nike-huarache_107.html for over Two centuries http://www.huaracherunpas-cher.fr/ , so that http://www.huaracherunpas-cher.fr/nike-huarache-rouge_81.html it is this http://www.huaracherunpas-cher.fr/nike-air-huarache-pas-chere_161.html oldest company http://www.huaracherunpas-cher.fr/air-flight-huarache_68.html of its kind in america http://www.huaracherunpas-cher.fr/nike-huarache-ultramarine_125.html and another http://www.huaracherunpas-cher.fr/nike-air-force-1-huarache_113.html from the major http://www.huaracherunpas-cher.fr/nike-huarache-homme_141.html inside New England. http://www.huaracherunpas-cher.fr/nike-huarache_93.html At first established http://www.huaracherunpas-cher.fr/nike-air-flight-huarache_102.html as being http://www.huaracherunpas-cher.fr/nike-id-huarache_158.html a orphanage throughout http://www.huaracherunpas-cher.fr/huarache-nike-blanche_127.html 1799, The property http://www.huaracherunpas-cher.fr/achat-nike-huarache_137.html nowadays performs any authority http://www.huaracherunpas-cher.fr/basket-nike-huarache_45.html function throughout supplying http://www.huaracherunpas-cher.fr/huarache-enfant_62.html solutions to countless http://www.huaracherunpas-cher.fr/nike-air-huarache-mid_78.html little ones http://www.huaracherunpas-cher.fr/nike-air-huarache-blanche_153.html and also families on http://www.huaracherunpas-cher.fr/huarache-light-og_105.html a yearly basis http://www.huaracherunpas-cher.fr/huarache-og-2017_143.html by way of a http://www.huaracherunpas-cher.fr/nike-air-flight-huarache-og_48.html process regarding http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-rose_58.html residential, community-based http://www.huaracherunpas-cher.fr/nike-air-huarache-run-pas-cher_98.html as well as prevention http://www.huaracherunpas-cher.fr/huarache-usa_100.html plans, one on one treatment services and support.

Comment by scott154 2 weeks and 3 days ago

Your point of view

You must be signed in to comment.