Commands tagged fun (13)

  • Shows "Bang!" in a chance of 1 out of 6, like in the original game with the gun (spin every round). Otherwise, echoes "Click...". If feeling brave you can also do: [ $[ $RANDOM % 6 ] == 0 ] && echo 'Bang!' && a really killer command || echo 'Click...' Show Sample Output

    [ $[ $RANDOM % 6 ] == 0 ] && echo 'Bang!' || echo 'Click...'
    paulera · 2016-03-23 11:09:56 0

  • 0
    emacs -f snake
    steadystatic · 2015-11-03 23:34:57 0
  • Generates labyrinth-like pattern on UTF-8 terminal in bash. For fun ;) Show Sample Output

    while ( true ) ; do if [ $(expr $RANDOM % 2 ) -eq 0 ] ; then echo -ne "\xE2\x95\xB1" ; else echo -ne "\xE2\x95\xB2" ; fi ; done
    tobi · 2015-01-17 12:46:37 3

  • -6
    figlet -f roman message
    ekinertac · 2013-04-23 02:25:39 0
  • This is longer than others on here. The reason for this is I have combined two different matrix commands so it would work on all computers. I logged onto my server through a computer and it worked fine. I logged into my server through a mac and it looked $4!t so I have made one that works through both. Show Sample Output

    echo -e "CHECK=SAMPLE" output --command_to_long
    techie · 2013-04-03 08:46:47 1

  • -3
    yum install fortune-firefly; fortune
    madrasi · 2011-01-26 04:32:03 0
  • you could save the code between if and fi to a shell script named with the first argument as and then do a to see if the command succeeded. a bit needless but who cares ;) Show Sample Output

    <commmand>; if [[ "$?" = 0 ]]; then echo ':)'; else echo ':('; fi
    potatoface · 2010-08-23 20:35:31 1
  • Let Tux bring the fortune cookie

    fortune | cowsay -f tux
    Zaphod · 2010-06-01 09:04:01 0

  • 8
    fortune | cowsay
    CodSpirit · 2010-05-31 13:23:39 0

  • 1
    cowsay $(fortune)
    mandroid · 2010-05-31 12:47:06 0
  • Strangely enough, there is no option --lines=[negative] with tail, like the head's one, so we have to use sed, which is very short and clear, you see. Strangely more enough, skipping lines at the bottom with sed is not short nor clear. From Sed one liner : # delete the last 10 lines of a file $ sed -e :a -e '$d;N;2,10ba' -e 'P;D' # method 1 $ sed -n -e :a -e '1,10!{P;N;D;};N;ba' # method 2 Show Sample Output

    seq 1 12 | sed 1,5d ; seq 1 12 | head --lines=-5
    flux · 2009-08-01 00:41:52 3
  • The British Government entering in the Gregorian era. Show Sample Output

    cal 09 1752
    flux · 2009-04-22 00:13:19 4
  • sudo apt-get install sl man sl

    Svish · 2009-04-19 15:24:03 11

What's this? is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands

Check These Out

insert ip range using vim
fast method for insert ip range using vim

Alias for quick command-line volume set (works also remotely via SSH)
If you're addicted to command-line solutions of ordinary actions or if you just want to set your volume from bed via mobile phone SSH, you can set this alias and use it as $ setvol 50 for setting volume on 50% gain Works only with ALSA, tested on Ubuntu 8.10. Give me some info about your experience. TIP: Try aslo command "mute" to toggle mute/unmute sound. But I don't know if this works on all distros.

resize all JPG images in folder and create new images (w/o overwriting)
Convert all jpegs in the current directory into ~1024*768 pixels and ~ 150 KBytes jpegs

Display current time in requested time zones.
The time zone names come from the tz database which is usually found at /usr/share/zoneinfo.

Install pip with Proxy
Installs pip packages defining a proxy

alias for psql command line; works similar for Oracles sqlplus commandline interface. if you do not provide stdin you will end up in the db shell.

Start an X app remotely
Launch a gui app remotely. In this example smplayer is installed on the remote machine, and movie.avi is in the remote user's home dir. Note that stdout/stderr is still local, so you'll have feedback locally, add '&>/dev/null' to suppress. This is surprisingly not well known (compared to running an X app locally via ssh -X). (NB. if your distro requires ~/.Xauthority file present, then try -fX if you have problems) Resubmitted (and trimmed, thanks sitaram) due to ridiculous voting on previous submission. Fingers crossed, it gets a better rating this time.

Daily watch "question pour un champion" (French TV show)
kaffeine could be replaced by any player able to read mms stream

A nice way to show git commit history, with easy to read revision numbers instead of the default hash

Summary of disk usage, excluding other filesystems, summarised and sorted by size
This command is useful for finding out which directories below the current location use the most space. It is summarised by directory and excludes mounted filesystems. Finally it is sorted by size.

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.


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: