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

FreeBSD is started up by the program 'init'. The first thing init does when

starting multiuser mode (ie, starting the computer up for normal use) is to

run the shell script /etc/rc. By reading /etc/rc and the /etc/rc.d/ scripts,

you can learn a lot about how the system is put together, which again will

make you more confident about what happens when you do something with it.

You can look through a file in a nice text-based interface by typing

less filename

nc(1) (or netcat) is useful not only for redirecting input/output to

TCP or UDP connections, but also for proxying them with inetd(8).

Want to list all files of an installed package? Enter

"pkg info -l packagename".

-- Lars Engels

To do a fast search for a file, try

locate filename

locate uses a database that is updated every Saturday (assuming your computer

is running FreeBSD at the time) to quickly find files based on name only.

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

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

Simple tcsh prompt: set prompt = '%# '

To clear the screen, use "clear". To re-display your screen buffer, press

the scroll lock key and use your page up button. When you're finished,

press the scroll lock key again to get your prompt back.

-- Dru

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

-- Mathieu

Want to know how many words, lines, or bytes are contained in a file? Type

"wc filename".

-- Dru

To see the IP addresses currently set on your active interfaces, type

"ifconfig -u".

-- Dru

The default editor in FreeBSD is vi, which is efficient to use when you have

learned it, but somewhat user-unfriendly. To use ee (an easier but less

powerful editor) instead, set the environment variable EDITOR to /usr/bin/ee

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

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

-- Lars Engels

You can use "whereis" to search standard binary, manual page and source

directories for the specified programs. This can be particularly handy

when you are trying to find where in the ports tree an application is.

Try "whereis firefox" and "whereis whereis".

-- Konstantinos Konstantinidis

When you've made modifications to a file in vi(1) and then find that

you can't write it, type ``!rm -f %'' then ``:w!'' to force the

write

This won't work if you don't have write permissions to the directory

and probably won't be suitable if you're editing through a symbolic link.

If you have sudo(8) installed and permissions to use it, type

``w ! sudo tee %'' to force a write.

To see how long it takes a command to run, type the word "time" before the

command name.

-- Dru

If you `set watch = (0 any any)' in tcsh, you will be notified when

someone logs in or out of your system.

You can disable tcsh's terminal beep if you `set nobeep'.

If you want to get a sorted list of all services that are started when FreeBSD boots,

enter "service -e".

-- Lars Engels