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/
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.
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
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:
you know the song... sing along
There is 1 alternative - vote for the best!
If you can do better, submit your command here.
You must be signed in to comment.
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 140Para 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
You're supposed to count down in hex...
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
... you just made my day really average.... remind me to post this on MLIA :)
echo "salue, amice, ut uales?" | espeak -v latin -s 140
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."
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."
echo {99..1}" bottles...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"