leestretton.com

You are in: > Home > Systems Administration

FreeBSD : Adding fortunes to appear after MOTD

The program 'fortune', which is often called in the .login file by default, has a nice collection of FreeBSD tips. You can access this a couple of ways:

$ /usr/games/fortune freebsd-tips

will print a single tip to your screen, while

$ /usr/games/fortune -m col freebsd-tips | less

will dump all the tips that contain the sequence 'col' to your screen. This will show you the nice short way using the col command to strip DOS End Of Line characters from your files (those are the ones that look like ^M in many places):

To get a fortune to appear when you login to your computer add the following line to the end of your .login file in your home directory

[ -x /usr/games/fortune ] && /usr/games/fortune freebsd-tips

If you do not already have fortune installed on your computer, you can install it by doing the following:

  1. Running sysinstall
  2. Selecting Configure
  3. Selecting Distributions
  4. Selecting Games

Then installing games from your preferred medium.

Related articles

Problem with this page? Let us know
© Lee Stretton 2005 | powered by linux powered by php 5 powered by MySQL download rss feeds powered by php 5 valid css