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

Random quote from Borat -- no html parsing

Terminal - Random quote from Borat -- no html parsing
curl -s "http://smacie.com/randomizer/borat.txt" | shuf -n 1 -
2014-12-16 04:18:48
User: benjabean1
2
Random quote from Borat -- no html parsing

Turns out smacie.com has a text file containing every single one of the borat quotes, each one on a newline. This makes it very convenient, as this can be done without any sed-parsing, and uses less bandwitdth!

Note that borate quotes are quite offensive, much more so than "fortunes-off"!

Alternatives

There are 7 alternatives - vote for the best!

Terminal - Alternatives
curl -s http://bash.org/?random1|grep -oE "<p class=\"quote\">.*</p>.*</p>"|grep -oE "<p class=\"qt.*?</p>"|sed -e 's/<\/p>/\n/g' -e 's/<p class=\"qt\">//g' -e 's/<p class=\"qt\">//g'|perl -ne 'use HTML::Entities;print decode_entities($_),"\n"'|head -1
2009-05-07 13:13:21
User: Iftah
Functions: grep head perl sed
7

bash.org is a collection of funny quotes from IRC.

WARNING: some of the quotes contain "adult" jokes... may be embarrassing if your boss sees them...

Thanks to Chen for the idea and initial version!

This script downloads a page with random quotes, filters the html to retrieve just one liners quotes and outputs the first one.

Just barely under the required 255 chars :)

Improvment:

You can replace the head -1 at the end by:

awk 'length($0)>0 {printf( $0 "\n%%\n" )}' > bash_quotes.txt

which will separate the quotes with a "%" and place it in the file.

and then:

strfile bash_quotes.txt

which will make the file ready for the fortune command

and then you can:

fortune bash_quotes.txt

which will give you a random quote from those in the downloaded file.

I download a file periodically and then use the fortune in .bashrc so I see a funny quote every time I open a terminal.

curl -s http://smacie.com/randomizer/borat.html | sed -nE "s# *<td valign=\"top\"><big><big><big><font face=\"Comic Sans MS\">(.*)</font></big></big></big></td>#\1#p"
2012-07-18 21:31:43
User: phymata
Functions: sed
1

I improved a bit on the original by only using sed and extracting the quote with a matching group.

Use -nE for sed on Mac OSX

Use -nr for sed on Linux.

Warning! The quotes from Borat are definitely offensive.

Know a better way?

If you can do better, submit your command here.

What others think

Here http://www.huaracherunpas-cher.fr/nike-air-huarache-90_110.html We require proper http://www.huaracherunpas-cher.fr/nike-huarache-marron_165.html care of each of our http://www.huaracherunpas-cher.fr/huarache-beige_106.html toes given http://www.huaracherunpas-cher.fr/nike-huarache-gris_59.html it bears our http://www.huaracherunpas-cher.fr/nike-air-huarache-bleu_167.html whole excess http://www.huaracherunpas-cher.fr/nike-huarache-boutique_147.html fat. Protecting these folks http://www.huaracherunpas-cher.fr/air-huarache-grise_142.html is important. And http://www.huaracherunpas-cher.fr/boutique-nike-huarache_151.html perhaps they http://www.huaracherunpas-cher.fr/nike-air-huarache-safari_73.html are your http://www.huaracherunpas-cher.fr/nike-huarache-solde_94.html feet's best friend. Women right now http://www.huaracherunpas-cher.fr/nike-air-huarache-light-pas-cher_44.html have made http://www.huaracherunpas-cher.fr/huarache-noir-et-rose_109.html shoes or http://www.huaracherunpas-cher.fr/air-flight-huarache_68.html boots for http://www.huaracherunpas-cher.fr/nike-air-huarache-prix_120.html being more than solely the http://www.huaracherunpas-cher.fr/nike-air-force-1-huarache_113.html feet's safeguard. http://www.huaracherunpas-cher.fr/nike-huarache-toute-noir_154.html Shoes and boots currently http://www.huaracherunpas-cher.fr/huarache-bleu_111.html are http://www.huaracherunpas-cher.fr/huarache-run_132.html getting to be http://www.huaracherunpas-cher.fr/air-huarache-solde_40.html girls passion. In fact, http://www.huaracherunpas-cher.fr/huarache-montante_179.html females relieve their http://www.huaracherunpas-cher.fr/nike-air-huarache-run-pas-cher_98.html particular pressure by means http://www.huaracherunpas-cher.fr/nike-huarache-blanc_85.html of purchasing http://www.huaracherunpas-cher.fr/nike-huarache-beige_91.html footwear. Women purchase http://www.huaracherunpas-cher.fr/achat-nike-huarache_137.html footwear they http://www.huaracherunpas-cher.fr/nike-air-huarache-blanche_153.html will extravagant given that http://www.huaracherunpas-cher.fr/nike-huarache-light-og_115.html they come across http://www.huaracherunpas-cher.fr/huarache-noir-et-blanc_96.html enjoyment as a result whatever http://www.huaracherunpas-cher.fr/nike-air-huarache-light_168.html the make of http://www.huaracherunpas-cher.fr/nike-huarache-prix_66.html http://www.huaracherunpas-cher.fr/huarache-2017_99.html the sneakers.However, a lot of http://www.huaracherunpas-cher.fr/nike-air-huarache-og-retro_101.html people obtain shoes http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine-og_75.html and boots solely http://www.huaracherunpas-cher.fr/huarache-enfant_62.html to protect their particular http://www.huaracherunpas-cher.fr/basket-nike-huarache_45.html foot. In case http://www.huaracherunpas-cher.fr/nike-huarache-2013_159.html you are shopping http://www.huaracherunpas-cher.fr/air-huarache-og_71.html http://www.huaracherunpas-cher.fr/air-huarache-noire_117.html for sneakers considering that http://www.huaracherunpas-cher.fr/huarache-5_74.html the preceding set of http://www.huaracherunpas-cher.fr/nike-air-max-huarache-hybrid_121.html two that you simply http://www.huaracherunpas-cher.fr/nike-huarache-rouge_81.html got are http://www.huaracherunpas-cher.fr/huarache-leopard_77.html certainly not http://www.huaracherunpas-cher.fr/nike-id-huarache_158.html relaxed as well http://www.huaracherunpas-cher.fr/huarache-acheter_83.html as will not last http://www.huaracherunpas-cher.fr/nike-air-huarache-chaussures_80.html seriously very http://www.huaracherunpas-cher.fr/nike-air-huarache-turquoise_160.html long, here are several http://www.huaracherunpas-cher.fr/air-huarache-run_157.html concepts that http://www.huaracherunpas-cher.fr/nike-air-huarache-taille_172.html you have to don't http://www.huaracherunpas-cher.fr/huarache-light_50.html forget when http://www.huaracherunpas-cher.fr/nike-huarache-premium_126.html you're look for sneakers:1. When http://www.huaracherunpas-cher.fr/huarache-nike-pas-cher_79.html choosing sneakers, just http://www.huaracherunpas-cher.fr/chaussures-air-huarache_128.html be http://www.huaracherunpas-cher.fr/huarache-nike-chaussures_131.html sure you are comfy http://www.huaracherunpas-cher.fr/nike-huarache-id_164.html inside it. Shoes http://www.huaracherunpas-cher.fr/nike-huarache-2_166.html and boots ought http://www.huaracherunpas-cher.fr/nike-huarache-run-pas-cher_61.html not to be http://www.huaracherunpas-cher.fr/nike-huarache-safari_52.html far http://www.huaracherunpas-cher.fr/nike-air-huarache-beige_112.html too tight or even unfastened. http://www.huaracherunpas-cher.fr/huarache-air-max_163.html Therefore, any http://www.huaracherunpas-cher.fr/nike-air-flight-huarache-og_48.html sneakers and http://www.huaracherunpas-cher.fr/nike-air-zoom-huarache_89.html that is the very least an http://www.huaracherunpas-cher.fr/air-huarache-nike_87.html inch larger than http://www.huaracherunpas-cher.fr/nike-huarache-free-run-2012_146.html your precise http://www.huaracherunpas-cher.fr/nike-huarache-chaussures_129.html dimensions are http://www.huaracherunpas-cher.fr/nike-huarache-free-run-pas-cher_156.html perfect for a http://www.huaracherunpas-cher.fr/air-max-huarache_39.html person's ft http://www.huaracherunpas-cher.fr/huarache-og-2017_143.html so that you http://www.huaracherunpas-cher.fr/nouvelle-nike-huarache_82.html can proceed along with http://www.huaracherunpas-cher.fr/nike-air-huarache-run_43.html take it easy http://www.huaracherunpas-cher.fr/nike-air-huarache-og_162.html while you are walking.2. http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-rose_58.html Flexible- Especially http://www.huaracherunpas-cher.fr/nike-huarache-run_72.html for wandering footwear http://www.huaracherunpas-cher.fr/nike-air-huarache-light-ultramarine_64.html , you'll want to http://www.huaracherunpas-cher.fr/nike-huarache-magenta_51.html be capable http://www.huaracherunpas-cher.fr/huarache-nike-noir_149.html of reach as well as http://www.huaracherunpas-cher.fr/air-huarache-blanc_123.html fold http://www.huaracherunpas-cher.fr/nike-huarache-free-light_134.html those to ensure are http://www.huaracherunpas-cher.fr/nike-air-huarache-blanc_41.html going to variable plenty http://www.huaracherunpas-cher.fr/nike-huarache-jd_46.html of http://www.huaracherunpas-cher.fr/chaussure-huarache-nike_173.html for ones feet. As well http://www.huaracherunpas-cher.fr/chaussure-air-huarache_180.html , you need http://www.huaracherunpas-cher.fr/nike-huarache-noir-et-bleu_130.html to be in a http://www.huaracherunpas-cher.fr/nike-air-huarache-international_104.html position to draw http://www.huaracherunpas-cher.fr/nike-air-huarache-retro_70.html both http://www.huaracherunpas-cher.fr/nike-huarache-light-ultramarine_171.html ends collectively so http://www.huaracherunpas-cher.fr/nike-huarache-femme-pas-cher_140.html your high heel splashes http://www.huaracherunpas-cher.fr/nike-huarache-pour-femme_155.html the actual toe element. The http://www.huaracherunpas-cher.fr/huarache-light-og_105.html vast http://www.huaracherunpas-cher.fr/nike-huarache-leopard_57.html majority of important http://www.huaracherunpas-cher.fr/nike-huarache-taille_49.html when you find http://www.huaracherunpas-cher.fr/huarrache-blanche_135.html yourself likely to be participating http://www.huaracherunpas-cher.fr/chaussures-huarache-nike_152.html in http://www.huaracherunpas-cher.fr/huarache-nike-blanche_127.html a sports http://www.huaracherunpas-cher.fr/huarache-bordeaux_53.html activity that will need http://www.huaracherunpas-cher.fr/nike-air-huarache-rouge_47.html someone to run or walk.3. http://www.huaracherunpas-cher.fr/nike-air-huarache-solde_181.html you have to http://www.huaracherunpas-cher.fr/nike-huarache-usa_114.html pick http://www.huaracherunpas-cher.fr/nikeair-huarache_88.html a pair http://www.huaracherunpas-cher.fr/free-huarache_103.html of shoes that could http://www.huaracherunpas-cher.fr/chaussure-nike-air-huarache_76.html really last. http://www.huaracherunpas-cher.fr/nike-air-huarache-run-chaussures_174.html the pair must be definitely http://www.huaracherunpas-cher.fr/huarache-4_118.html worth the price tag. http://www.huaracherunpas-cher.fr/huarache-free-run_145.html to put http://www.huaracherunpas-cher.fr/nike-air-huarache-1991_65.html it differently, durability http://www.huaracherunpas-cher.fr/nike-air-flight-huarache_102.html is significant in http://www.huaracherunpas-cher.fr/huarache-og_183.html buying shoes.4. Today http://www.huaracherunpas-cher.fr/air-nike-huarache_107.html , sneakers also come http://www.huaracherunpas-cher.fr/air-huarache-noir_116.html in unique shades, http://www.huaracherunpas-cher.fr/nike-huarache-violet_54.html styles. Seek to decide http://www.huaracherunpas-cher.fr/huarache-noir_86.html on a http://www.huaracherunpas-cher.fr/huarache-chaussures_95.html set in http://www.huaracherunpas-cher.fr/huarache-noir-femme_60.html which speaks of the http://www.huaracherunpas-cher.fr/air-huarache-femme_90.html personality. Ladies, specially, http://www.huaracherunpas-cher.fr/nike-huarache-fille_148.html will have a a http://www.huaracherunpas-cher.fr/nike-air-huarache-mid_78.html number of shoes http://www.huaracherunpas-cher.fr/nike-air-huarache-homme_150.html selections http://www.huaracherunpas-cher.fr/huarache-instagram_169.html they are able http://www.huaracherunpas-cher.fr/nike-huarache-agassi_133.html to choose from. It's http://www.huaracherunpas-cher.fr/nike-air-force-huarache_124.html also vital http://www.huaracherunpas-cher.fr/basket-huarache_63.html that you can potentially pul http://www.huaracherunpas-cher.fr/chaussures-huarache_56.html http://www.huaracherunpas-cher.fr/acheter-huarache_84.html the complete ensemble alongside one http://www.huaracherunpas-cher.fr/huarache-vintage_42.html another. The http://www.huaracherunpas-cher.fr/ shoes that http://www.huaracherunpas-cher.fr/nike-huarache-paris_69.html you're going to decide on needs http://www.huaracherunpas-cher.fr/nike-huarache-3_108.html to be comfortable http://www.huaracherunpas-cher.fr/air-huarache-paris_138.html to http://www.huaracherunpas-cher.fr/air-huarache-homme_67.html wear, certainly.In http://www.huaracherunpas-cher.fr/huarache-femmes_170.html basic, ease, type http://www.huaracherunpas-cher.fr/nike-air-huarache-pas-chere_161.html in addition to security of http://www.huaracherunpas-cher.fr/huarache-usa_100.html the legs will http://www.huaracherunpas-cher.fr/nike-air-huarache-noir_97.html be http://www.huaracherunpas-cher.fr/air-huarache-light_139.html several belongings you shouldn't http://www.huaracherunpas-cher.fr/nike-air-huarache-original_144.html skimp on when scouting for http://www.huaracherunpas-cher.fr/nike-huarache-femmes_182.html footwear. Regardless of http://www.huaracherunpas-cher.fr/nike-huarache_93.html the http://www.huaracherunpas-cher.fr/nike-huarache-ultramarine_125.html aim of these http://www.huaracherunpas-cher.fr/nike-air-huarache-2_92.html comfortable shoes, http://www.huaracherunpas-cher.fr/nike-huarache-homme_141.html make sure you obtain the http://www.huaracherunpas-cher.fr/huarache-chaussure_122.html pair that http://www.huaracherunpas-cher.fr/nike-huarache-1991_55.html will serve that purpose assure for you to look great wearing them likewise.

Comment by scott154 19 weeks and 5 days ago

Your point of view

You must be signed in to comment.