Commands tagged fortune (10)

  • You need to have fortune and cowsay installed. It uses a subshell to list cow files in you cow directory (this folder is default for debian based systems, others might use another folder). you can add it to your .bashrc file to have it great you with something interesting every time you start a new session. Show Sample Output

    fortune | cowsay -f $(ls /usr/share/cowsay/cows/ | shuf -n1)
    zed · 2010-07-08 02:57:52 2

  • 8
    fortune | cowsay
    CodSpirit · 2010-05-31 13:23:39 0
  • 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. Show Sample Output

    curl -s|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
    Iftah · 2009-05-07 13:13:21 6

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

    curl -s | sed -nE "s# *<td valign=\"top\"><big><big><big><font face=\"Comic Sans MS\">(.*)</font></big></big></big></td>#\1#p"
    phymata · 2012-07-18 21:31:43 0
  • Let Tux bring the fortune cookie

    fortune | cowsay -f tux
    Zaphod · 2010-06-01 09:04:01 0
  • Can be installed in the root crontab if you want it to update your motd. If not on ubuntu you need to change /usr/share/cowsay/cows/* to the location of your cow files. Show Sample Output

    files=(/usr/share/cowsay/cows/*);cowsay -f `printf "%s\n" "${files[RANDOM % ${#files}]}"` "`fortune`"
    dog · 2010-06-02 14:18:28 0
  • Shows a list of all installed cows saying a fortune. Also lists the cows names. Pic your favorite cow! Needs cowsay, fortune and ruby installed. The path only applies to OS X with cowsay installed using homebrew. On Linux it might be /usr/share/cowsay/cows/ or similar. Uses ruby just because. Show Sample Output

    echo 'Dir.foreach("/usr/local/Cellar/cowsay/3.03/share/cows") {|cow| puts cow; system "fortune | cowsay -f /usr/local/Cellar/cowsay/3.03/share/cows/#{cow}" }' | ruby
    orkoden · 2013-04-15 12:27:38 0
  • To install on centos 6.2 for Centos auto accept: yum install fortune* -y yum install cowsay* -y Removed the -f command as I dont know how, but it works without it. Almost the same but one folder higher =).

    fortune | cowsay $(ls/usr/share/cowsay | shuf -n1)
    cablegunmaster · 2014-10-23 10:09:44 1
  • Get colorful fortunes dictated by an ASCII cow. For full enjoyment you'll need to have color setup enabled for your terminal.

    cowsay `fortune` | toilet --metal -f term
    seattlegaucho · 2010-06-03 21:48:54 1

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

Take a screenshot of the focused window with a 4 second countdown
Take a screenshot of the focused window with a 4 second countdown # shorten by adding to your .bashrc: alias sss='scrot -ucd4 && eog $(ls -tr | tail -n1)' $ echo -e "\nalias sss='scrot -ucd4 && eog $(ls -tr | tail -n1)'" >> ~/.bashrc -d 4 second delay -c display countdown -u focused window man scrot for more flags

Install pip with Proxy
Installs pip packages defining a proxy

Text graphing ping output filter
Nasty perl one-liner that provides a sparkline of ping times. If you want a different history than the last 30, just put that value in. It (ab)uses unicode to draw the bars, inspired by . It's not the most bug-free piece of code, but what it lacks in robustness it makes up for in capability. :) If anyone has any ideas on how to make it more compact or better, I'd love to hear them. I included a ping to google in the command just as an example (and burned up 10 chars doing it!). You should use it with: $ ping | $SPARKLINE_PING_COMMAND

Go up multiple levels of directories quickly and easily.
This is a kind of wrapper around the shell builtin cd that allows a person to quickly go up several directories. Instead of typing: cd ../.. A user can type: cd ... Instead of: cd ../../.. Type: cd .... Add another period and it goes up four levels. Adding more periods will take you up more levels.

list block devices
Shows all block devices in a tree with descruptions of what they are.

Show which programs are listening on TCP and UDP ports
-p Tell me the name of the program and it's PID -l that is listening -u on a UDP port. -n Give me numeric IP addresses (don't resolve them) -t oh, also TCP ports

MPD + Digitally Imported
1.- Enter into the playlist path. 2.- Run the command. 3.- Playlists created!

list files recursively by size

function to edit your history file
eh stands for Edit History . Frequently, I'll mistype a command, and then step back through my history and correct the command. As a result, both the correct and incorrect commands are in my history file. I wanted a simple way to remove the incorrect command so I don't run it by mistake. . When running this function, first the ~/bash_history file is updated, then you edit the file in vi, and then the saved history file is loaded back into memory for current usage. . while in vi, remember that `Shift-G` sends you to the bottom of the file, and `dd` removes a line. . this command is different than bash built-in `fc` because it does not run the command after editing.

Adding Prefix to File name

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: