Can't delete /usr/obj? Enter "chflags -R noschg /usr/obj" to remove the
system immutable flag for all files in /usr/obj.
-- Lars Engels
You can change the video mode on all consoles by adding something like
the following to /etc/rc.conf:
allscreens="80x30"
You can use "vidcontrol -i mode | grep T" for a list of supported text
modes.
-- Konstantinos Konstantinidis
Want to know how many words, lines, or bytes are contained in a file? Type
"wc filename".
-- Dru
This fortune brought to you by:
$FreeBSD$
Need to remove all those ^M characters from a DOS file? Try
tr -d \\r < dosfile > newfile
-- Originally by Dru
Need to do a search in a manpage or in a file you've sent to a pager? Use
"/search_word". To repeat the same search, type "n" for next or "p" for
previous.
-- Dru
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
Time to change your password? Type "passwd" and follow the prompts.
-- Dru
Want to strip UTF-8 BOM(Byte Order Mark) from given files?
sed -e '1s/^\xef\xbb\xbf//' < bomfile > newfile
Don't let your zpool fill up completely by creating a dataset with
reservation.
# zfs create -o refreservation=<5% of total pool space>
You can always shrink the reserve if you need the space, but your pool will
always have space left this way.
-- Benedict Reuschling
If you accidentally end up inside vi, you can quit it by pressing Escape, colon
(:), q (q), bang (!) and pressing return.
"man security" gives very good advice on how to tune the security of your
FreeBSD system.
This fortune brought to you by:
$FreeBSD$
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
Need to quickly return to your home directory? Type "cd".
-- Dru
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
Do you want to know which version of FreeBSD you are running? Enter
"freebsd-version -ku" to display kernel and userland version.
-- Lars Engels
When using ZFS as the file system the "df" command is reporting the pool size
and not file system sizes. It also does not know about descendent ZFS
datasets, snapshots, quotas, and reservations with their individual space usage.
Use the built-in "zfs list" command to get a better overview of space usage:
zfs list -o space
-- Benedict Reuschling
ZFS keeps a history of commands run against a specific pool using the
history subcommand to zpool:
zpool history
More details are available using the -i and -l parameters. Note that ZFS
will not keep the complete pool history forever and will remove older
events in favor of never ones.
-- Benedict Reuschling
In order to support national characters for European languages in tools like
less without creating other nationalisation aspects, set the environment
variable LC_ALL to 'en_US.UTF-8'.