Commands tagged fun (14)

  • sudo apt-get install sl man sl


    24
    sl
    Svish · 2009-04-19 15:24:03 25
  • The British Government entering in the Gregorian era. Show Sample Output


    10
    cal 09 1752
    flux · 2009-04-22 00:13:19 38

  • 8
    fortune | cowsay
    CodSpirit · 2010-05-31 13:23:39 4
  • Outputs utf-8 smileys Show Sample Output


    5
    printf "$(awk 'BEGIN{c=127;while(c++<191){printf("\xf0\x9f\x98\\%s",sprintf("%o",c));}}')"
    ichbins · 2022-04-06 12:10:37 437
  • you could save the code between if and fi to a shell script named smiley.sh with the first argument as and then do a smiley.sh to see if the command succeeded. a bit needless but who cares ;) Show Sample Output


    4
    <commmand>; if [[ "$?" = 0 ]]; then echo ':)'; else echo ':('; fi
    potatoface · 2010-08-23 20:35:31 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


    4
    [ $[ $RANDOM % 6 ] == 0 ] && echo 'Bang!' || echo 'Click...'
    paulera · 2016-03-23 11:09:56 29
  • Generates labyrinth-like pattern on UTF-8 terminal in bash. For fun ;) Show Sample Output


    2
    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 10

  • 1
    cowsay $(fortune)
    mandroid · 2010-05-31 12:47:06 3
  • 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


    0
    seq 1 12 | sed 1,5d ; seq 1 12 | head --lines=-5
    flux · 2009-08-01 00:41:52 8
  • Let Tux bring the fortune cookie


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

  • 0
    emacs -f snake
    steadystatic · 2015-11-03 23:34:57 40
  • 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


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

  • -3
    yum install fortune-firefly; fortune
    madrasi · 2011-01-26 04:32:03 4

  • -6
    figlet -f roman message
    ekinertac · 2013-04-23 02:25:39 12

What's this?

commandlinefu.com 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

Look for English words in /dev/urandom
* to get the English dictionary: wget http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt

Make Kali Linux look less suspicious by making the desktop look more like a windows machine
To revert back to Kali's original desktop. Just redo the same command with no options .

HTTP GET request on wireshark remotly

edit hex mode in vim
return to normal mode from hex mode :%!xxd -r

Check if it's your binary birthday!
Print out your age in days in binary. Today's my binary birthday, I'm 2^14 days old :-) . This command does bash arithmatic $(( )) on two dates: Today: $(date +%s) Date of birth: $(date +%s -d YYYY-MM-DD) The dates are expressed as the number of seconds since the Unix epoch (Jan 1970), so we devide the difference by 86400 (seconds per day). . Finally we pipe "obase=2; DAYS-OLD" into bc to convert to binary. (obase == output base)

diff the same file in two directories.
This is useful when you're diffing two files of the same name in radically different directory trees. For example: Set $ path1='/some/long/convoluted/path/to/all/of/your/source/from/a/long/dead/machine' then $ path2='/local/version/of/same/file' then run the command. Much easier on the eyes when you're looking back across your command history, especially if you're doing the same diff over and over again.

Belgian banking "structured communication"
Derived from current time down to minutes.

List detailed information about a ZIP archive
list zipfile info in long Unix ``ls -l'' format.

draw line separator (using knoppix5 idea)

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.


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: