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

If you need to ask a question on the FreeBSD-questions mailing list then

https://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/\

freebsd-questions/index.html

contains lots of useful advice to help you get the best results.

To quickly create an empty file, use "touch filename".

-- Dru

You can open up a new split-screen window in (n)vi with :N or :E and then

use ^w to switch between the two.

Need to find the location of a program? Use "locate program_name".

-- Dru

You can use the 'fetch' command to retrieve files over ftp, http or https.

fetch

will download the beastie image from the FreeBSD web site.

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

You can search for documentation on a keyword by typing

apropos keyword

To see the MAC addresses of the NICs on your system, type

ifconfig -a

-- Dru

Want to know how much memory (in bytes) your machine has installed? Let

sysctl(8) tell you with the following command:

sysctl hw.realmem

The realmem value is memory before the kernel and modules are loaded, whereas

hw.physmem is what is left after they were loaded.

The number of active CPUs is displayed using this command:

sysctl hw.ncpu

-- Benedict Reuschling

To see the 10 largest files in a directory or on a UFS partition, use

du -h /partition_or_directory_name | sort -rh | head

-- Dru

To see how much disk space is left on your UFS partitions, use

df -h

-- Dru

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

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

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

enter "service -e".

-- Lars Engels

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

"man tuning" gives some tips how to tune performance of your FreeBSD system.

-- David Scheidt

To set a custom ZFS property on the mypool pool, you need to provide it

using the "key1:key2=value" syntax, where the colon (:) is used as the

separator and identifier from the built-in ZFS properties:

# zfs set warranty:expires=2038-01-19 mypool

The custom property is applied to all datasets and can be queried like any

built-in properties using zfs get:

zfs get warranty:expires mypool

To reset the value of a custom property, use the inherit subcommand:

# zfs inherit warranty:expires mypool

Removing a custom property from a pool is done using the -r flag to the

"zfs inherit" command:

# zfs inherit -r warranty:expires mypool

-- Benedict Reuschling

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

someone logs in or out of your system.

Want to run the same command again?

In many shells (e.g., tcsh, zsh, bash) you can type "!!".

Can't remember if you've installed a certain port or not? Try "pkg info

-x port_name".

To see the 10 largest files in a directory or on a UFS partition, use

du -h /partition_or_directory_name | sort -rh | head

-- Dru