Command Line

How To: Display Your Fortune In The Terminal

Today’s article is just a silly article, one where you learn how to display your fortune in the terminal. It’ll be fun! It’ll also be quick and easy, probably. If you’re expecting anything serious, this is not the article for you. No… No, it is not!

Once in a while, we remember that all work and no play makes Jack a dull boy. Well, we don’t want to be a dull boy, so let’s do something that serves absolutely no benefit. Let’s just have unadulterated fun. It’s my site, I’ll do what I want!

To be fair, I’ve already cover this same topic. I shared how to use ‘cowsay’ with ‘fortune’. I suppose it’s cheating, but this time we’re just going to use the ‘fortune‘ aspect. Trust me, it’s a very different article.

Yes, it’s an excuse to have a quick and easy article. I had an easy article the last time and I still want an easy article. I don’t want to burnout and we’ve had more than 300 articles. So, an easy spell is nice. It’ll help prevent burnout. I’ll be over it in a day or two, I assume. (Note that I didn’t promise.)

Remember, a goal of the site is to be found by search. So, having a ‘fortune’ specific article isn’t a bad thing. Not everyone will want the silliness of ‘cowsay‘. (They not very fun people, but they’re people and they exist!)

So then, let’s just get going with the silliness…

Display Your Fortune In The Terminal:

Obviously, you need an open terminal! It’s right there in the title! If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

With your terminal open, you need to install ‘fortune’. It’s probably available for those using apt and those using rpm based package managers. It may be available for others, but I have not checked. So, to install it:

On apt-based distros:

sudo apt install fortune

On rpm-based distros:

sudo yum install fortune

With ‘fortune’ happily installed, and feel free to try in other package managers – but leave a comment if they work, you can start with the basic ‘fortune’ command:

fortune

Now, as this is just a fun article, I’m actually going to cheat. I’m going to suggest you just use the man page to learn more:

man fortune

See, this is why I wanted to cover ‘fortune’ by itself. There are a whole lot of options available for such a silly program. Of all of them, my favorite one is the -l flag. That one throws out longer fortunes, like this one:

kgiii@kgiii-lmde:~$ fortune -l
The Least Perceptive Literary Critic
 The most important critic in our field of study is Lord Halifax.  A
most individual judge of poetry, he once invited Alexander Pope round to
give a public reading of his latest poem.
 Pope, the leading poet of his day, was greatly surprised when Lord
Halifax stopped him four or five times and said, "I beg your pardon, Mr.
Pope, but there is something in that passage that does not quite please me."
 Pope was rendered speechless, as this fine critic suggested sizeable
and unwise emendations to his latest masterpiece.  "Be so good as to mark
the place and consider at your leisure.  I'm sure you can give it a better
turn."
 After the reading, a good friend of Lord Halifax, a certain Dr.
Garth, took the stunned Pope to one side.  "There is no need to touch the
lines," he said.  "All you need do is leave them just as they are, call on
Lord Halifax two or three months hence, thank him for his kind observation
on those passages, and then read them to him as altered.  I have known him
much longer than you have, and will be answerable for the event."
 Pope took his advice, called on Lord Halifax and read the poem
exactly as it was before.  His unique critical faculties had lost none of
their edge.  "Ay", he commented, "now they are perfectly right.  Nothing can
be better."
  -- Stephen Pile, "The Book of Heroic Failures"

See?!? The ‘fortune’ command is pure awesomeness! If you’re anything like a cat, or myself, you can bat at the fortune command (as though it was a balled up piece of paper) for way longer than what seems reasonable.

So, check that man page and have fun with ‘fortune’. For example, you can (with the default configuration – and you can do way more with ‘fortune’ than one might ever possibly wish) run one of the following commands:

fortune riddle
fortune literature
fortune fortunes

So, have fun with it. I do! I revisit the command far more often than one might think a grown adult would. Even then, and my memory kinda sucks, I don’t think I’ve read them all. It’s a gift that keeps on giving.

Closure:

And there you have it… You can now display your fortune in the terminal. I mean, it’s probably not really your fortune – but that doesn’t mean you can’t have some fun with it. Life is short, but not too short to have some fun in the Linux terminal.

By the way, like the last article, this article was prompted by an recent article on a forum I frequent. Nobody mentioned the ‘fortune’ command, so I figured I’d return to it and try to give it some justice. It’s a fun application with way more  options than it needs – and that’s awesome.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

A Quick Look At The Shutdown Command

This is going to be just a quick article about a command many of you…

2 days ago

Setting Up Coding Environments on Linux for Educational Use

With so many strong attributes, such as robustness and flexibility, Linux stands as a powerful…

4 days ago

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

6 days ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

1 week ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

1 week ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

2 weeks ago