Avatar
FreeBSD Fortune
49792b0c3e803bb97f4005f83a8d6c09a58c6ea7f04e1ab19d149f9fabbbcee3
This account is a bot that will post a FreeBSD Fortune every day. Subscribe, comment, and share!

After you compiled and installed a new version of FreeBSD, use etcupdate(8) to merge

configuration updates.

Run "etcupdate extract" once when your sources match your running system, then run

"etcupdate" after every upgrade and "etcupdate resolve" to resolve any conflicts.

-- Lars Engels

You can prevent the removal of a ZFS snapshot by using the hold subcommand.

For example, to prevent the snapshot called milestone from deletion, run the

following command:

# zfs hold milestone_hold mypool/projects@my_milestone

The "zfs holds" command will list all current snapshots that are protected

this way (-r for a recursive list):

# zfs holds -r mypool

The TIMESTAMP column in the output of the above command is from when the

hold was created, not the snapshot it holds. The "zfs destroy" command will

echo a "dataset is busy" message on the console when it encounters a hold.

Use "zfs release" to release the hold on the snapshot:

# zfs release milestone_hold mypool/projects@my_milestone

-- Benedict Reuschling

Want colour in your directory listings? Use "ls -G". "ls -F" is also useful,

and they can be combined as "ls -FG".

Nice bash prompt: PS1='(\[$(tput md)\]\t <\w>\[$(tput me)\]) $(echo $?) \$ '

-- Mathieu

To set a quota of 10 GB for the user named foo on a ZFS dataset, run the

following command:

# zfs set userquota@foo=10G pool/home/foo

The zfs userspace command can display the quota and current space usage:

# zfs userspace pool/home/foo

To unset a quota, assign "none" as the value.

-- Benedict Reuschling

By pressing "Scroll Lock" you can use the arrow keys to scroll backward

through the console output. Press "Scroll Lock" again to turn it off.

Don't have a "Scroll Lock" key? The "Pause / Break" key acts alike.

To read a compressed file without having to first uncompress it, use

"zcat" or "zless" to view it. There is also "bzcat", "bzless", "xzcat"

and "xzless".

-- Dru

If you have a CD-ROM drive in your machine, you can make the CD-ROM that is

presently inserted available by typing 'mount /cdrom' as root. The CD-ROM

will be available under /cdrom/. Remember to do 'umount /cdrom' before

removing the CD-ROM (it will usually not be possible to remove the CD-ROM

without doing this.)

Note: This tip may not work in all configurations.

To change an environment variable in tcsh you use: setenv NAME "value"

where NAME is the name of the variable and "value" its new value.

You can press up-arrow or down-arrow to walk through a list of

previous commands in tcsh.

Handy bash(1) prompt: PS1="\u@\h \w \!$ "

-- David Scheidt

This fortune brought to you by:

$FreeBSD$

To obtain a neat PostScript rendering of a manual page, use ``-t'' switch

of the man(1) utility: ``man -t ''. For example:

man -t grep > grep.ps # Save the PostScript version to a file

or

man -t printf | lp # Send the PostScript directly to printer

Want to list all files of an installed package? Enter

"pkg info -l packagename".

-- Lars Engels

If you use the C shell, add the following line to the .cshrc file in your

home directory to prevent core files from being written to disk:

limit coredumpsize 0

-- Dru

If you accidentally end up inside vi, you can quit it by pressing Escape, colon

(:), q (q), bang (!) and pressing return.

To read a compressed file without having to first uncompress it, use

"zcat" or "zless" to view it. There is also "bzcat", "bzless", "xzcat"

and "xzless".

-- Dru

Do you want to know which version of FreeBSD you are running? Enter

"freebsd-version -ku" to display kernel and userland version.

-- Lars Engels

ZFS can display I/O statistics for a given pool using the iostat subcommand.

By default, it will display one line of current activity. To display stats

every 5 seconds run the following command (cancel with CTRL+C):

zpool iostat 5

To view individual disk activities, specify the -v parameter:

zpool iostat -v

Of course, both can be combined. For more options, see zpool(8).

-- Benedict Reuschling

In order to make fetch (the FreeBSD downloading tool) ask for

username/password when it encounters a password-protected web page, you can set

the environment variable HTTP_AUTH to 'basic:*'.