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.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

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.

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

2011-03-12 - Confoo 2011 presentation
Slides are available from the commandlinefu presentation at Confoo 2011: http://presentations.codeinthehole.com/confoo2011/
2011-01-04 - Moderation now required for new commands
To try and put and end to the spamming, new commands require moderation before they will appear on the site.
2010-12-27 - Apologies for not banning the trolls sooner
Have been away from the interwebs over Christmas. Will be more vigilant henceforth.
2010-09-24 - OAuth and pagination problems fixed
Apologies for the delay in getting Twitter's OAuth supported. Annoying pagination gremlin also fixed.
Hide

Tags

Hide

Functions

your terminal sings

Terminal - your terminal sings
echo {1..199}" bottles of beer on the wall, cold bottle of beer, take one down, pass it around, one less bottle of beer on the wall,, " | espeak -v english -s 140
2010-02-04 04:38:52
User: op4
Functions: echo
20
your terminal sings

you know the song... sing along

Alternatives

There are 5 alternatives - vote for the best!

Terminal - Alternatives

Know a better way?

If you can do better, submit your command here.

What others think

My version:

(g=echo;s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=99;i>0;i--));do [ $i == 1 ]&&unset s;$g -n "$i $o$s $e $w, $i $o$s $e. $a, `[ $[i-1] != 0 ]&&$g $[i-1]||$g "n$n"` $o`[ $i != 2 ]&&$g s` $e $w. ";done;$g -ne "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, 99 ${o}s $e $w.")|espeak -v english -s 140
Comment by eightmillion 233 weeks and 4 days ago

Para los hispanoparlantes:

echo {1..199}" elefantes se balanceaban sobre la tela de una ara?a, como ve?an que no se ca?an, fueron a llamar a otro elefante,, " | espeak -v spanish -s 140

Comment by kutus 233 weeks and 4 days ago

You're supposed to count down in hex...

Comment by SuperFly 233 weeks and 4 days ago

For OSX, substitute espeak with say:

(g=echo;s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=99;i>0;i--));do [ $i == 1 ]&&unset s;$g -n "$i $o$s $e $w, $i $o$s $e. $a, `[ $[i-1] != 0 ]&&$g $[i-1]||$g "n$n"` $o`[ $i != 2 ]&&$g s` $e $w. ";done;$g -ne "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, 99 ${o}s $e $w.")| say

Comment by antic 233 weeks and 4 days ago

... you just made my day really average.... remind me to post this on MLIA :)

Comment by GinoMan2440 233 weeks and 4 days ago

echo "salue, amice, ut uales?" | espeak -v latin -s 140

Comment by bubo 233 weeks and 3 days ago

Sing it in Hexadecimal:

s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=255;i>0;i--));

do [ $i == 1 ] && unset s; ihex=$(echo "obase=16; $i" | bc);

echo "$ihex $o$s $e $w, $ihex $o$s $e. $a, `[ $[i-1] != 0 ] && echo $(echo "obase=16; $[i-1]" | bc) || echo "n$n"` $o`[ $i != 2 ] && echo s` $e $w. ";done;echo -e "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, FF ${o}s $e $w."

Comment by SuperFly 233 weeks and 3 days ago

This works better, but can we do it in less that 255 characters?

s=s;n="o more";o="bottle";e="of beer";a="Take one down and pass it around";w="on the wall";for ((i=255;i>0;i--));do [ $i == 1 ] && unset s;ihex=$(echo "obase=16; $i" | bc);echo "$ihex $o$s $e $w, $ihex $o$s $e. $a, `[ $[i-1] != 0 ] && echo $(echo "obase=16; $[i-1]" | bc) || echo "n$n"` $o`[ $i != 2 ] && echo s` $e $w. ";done;echo -e "N$n ${o}s $e $w, n$n ${o}s $e. Go to the store and buy some more, FF ${o}s $e $w."

Comment by SuperFly 233 weeks and 3 days ago
echo {99..1}" bottles...
Comment by dennisw 233 weeks and 1 day ago

As Antic said, on the mac substitute "espeak" with "say", but add the Cellos voice:

echo {1..199}" bottles of beer on the wall, cold bottle of beer, take one down, pass it around, one less bottle of beer on the wall.. " | say -v Cellos

Here a list of other voices you can play with on a mac:

Female Voices

say -v Agnes "hello world" say -v Kathy "hello world" say -v Princess "hello world" say -v Vicki "hello world" say -v Victoria "hello world"

Male Voices

say -v Bruce "hello world" say -v Fred "hello world" say -v Junior "hello world" say -v Ralph "hello world"

Novelty Voices

say -v Albert "hello world" say -v "Bad News" "hello world" say -v Bahh "hello world" say -v Bells "hello world" say -v Boing "hello world" say -v Bubbles "hello world" say -v Cellos "hello world" say -v Deranged "hello world" say -v "Good News" "hello world" say -v Hysterical "hello world" say -v "Pipe Organ" "hello world" say -v Trinoids "hello world" say -v Whisper "hello world" say -v Zarvox "hello world"
Comment by netsaint 233 weeks ago

Your point of view

You must be signed in to comment.

Related sites and podcasts