locked by Mark Henderson♦ Dec 23 '11 at 22:28
This question exists because it has historical significance, but it is not considered a good, on-topic question for this site so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. See the help center for guidance on writing a good question.
Read more about locked posts here.
I've accidentally found in the source of
cp command (FreeBSD 7.2); the
SIGINFO signal handler: if you press Ctrl+T while
cp is copying something huge, you will see (along with other info) the progress of the operation in percent!
I'm surprised no one has mentioned jail yet. Very similar to zones in Solaris, jails offer a very convenient and secure way to isolate applications as well as creating virtual hosts.
An old one (these days) is the background fsck and filesystem snapshots.
I've always rather liked the various 'stat' commands and the way systat ties them alot of them together. It's a great addition to top. Linux doesn't seem to have the various collection of 'stat' commands that FreeBSD has.
Availability of three different packet filters to suit your preference -- ipfw, ipf, and OpenBSD's pf.
Here are a couple of basic ones from my tool bag. I left out the things that are common to multiple Unix-likes, but many of the Linux "hidden features" tips are also usable on FreeBSD.
I also tried to avoid saying things like "ZFS rocks." While I think that's true, it's not really very hidden. :-)
- When on the local console of a vanilla system, if the keyboard is sloooow, you can use
kbdcontrol -r fastto bump up your keyboard delay and repeat rate.
- You can use the
/boot.configfile (yes, that's a file in the root of
/) to use both the serial port and the video/keyboard for console. See
- The Alt-F[1-8] keys get you virtual consoles, and
lock -nvpwill let you lock them all down if you need to walk away for a bit.
- Tapping Scroll Lock lets you use PageUp/PageDown to see previous screens that have rolled off the top of your monitor.
- You can configure site-wide and box-specific versions of a number of configuration files using a
.localsuffix, most notably
/etc/rc.conf.local. For example, things you enable on all systems (like
sshd) can go into
/etc/rc.conf, and local overrides (like interface configs, hostnames, local daemons, etc.) can go into
/etc/rc.conf.local. This is a simple way to let you push out side-wide changes without overwriting box-specific
rcstuff. It doesn't hold a candle to Puppet or its kin, but it's a lightweight way to do distributed configuration.
- The full initial dmesg at boot time is always available in
top -mioshows the top I/O talkers.
- You don't have to be using ZFS to do filesystem snapshots - see
mksnap_ffs(8). Not as full-featured as ZFS, but a simple add-on to existing UFS filesystems. These snapshots can be mounted with
/etc/fstab, if you configure the mount type (fourth field) as
xx, that mount line is ignored - great for documenting fallow partitions.
man hierexplains the filesystem layout at a high level.
mdconfigto mount ISOs.
- You can use
/etc/login.confto change the default password hashing function to blowfish with
- If you're rolling your own kernel, you can create your kernel config by including an existing kernel config by reference, and then just adding the differences. You can also override inherited items with
nomakeoptions. For example, here's how to make a kernel that includes all of GENERIC, but simply adds some debugging options and a few tweaks (and this is the entire file):
include GENERIC ident DEBUG-GENERIC options KDB options DDB nooptions COMPAT_FREEBSD4 nooptions COMPAT_FREEBSD5 nooptions COMPAT_FREEBSD6 # This is actually the default; just an example. makeoptions DEBUG=-g nodevice atkbdc nodevice atkbd nodevice psm
Ports management and software:
-coption that asks you all of those port configuration questions before the downloads and installs begin - a major time-saver.
- You can report on all ports with known security issues with
security/portaudit. It also adds its own report to the daily security output.
- If you have to override enforcement of security for the installation of a specific port (hopefully only for internal or temporary use!) you can
portsclean -Dremoves all distfiles not referenced by any active ports.
ports-mgmt/portdowngradelets you downgrade to a specific version of a port - very handy if you find out that your upgrade broke something important. It requires exporting the ANONCVS environment variable first, containing the CVS URL (which I always forget and have to go look up).
- You can use
ports-mgmt/pkg_cutleavesto prune packages that have no other dependencies. Use
/usr/local/etc/pkg_leaves.excludeto keep a list of packages that you always want to keep, but that no other packages depend on.
- Linux binary compatibility.
- If you're running a server, add
/etc/make.confto automatically skip X for most (well-behaved) ports.
- @Henry Flower's note about sending SIGINFO to
cpfor progress information also works for
- My on-every-box port list includes
Edited to fix orphaned kernel config, and minor grammar.
sysctl and everything you can change with that mechanism.
DTrace, because it is rather new to the system
% grep -A4 JOKE /usr/src/usr.bin/make/job.c #ifndef WITHOUT_OLD_JOKE if (strcmp(gn->name,"love") == 0) (*abortProc)("Not war."); else #endif % make love Not war. Exit 2
Not hidden (they are quite common), but critical for basic FreeBSD use:
- uname -aar
- portsnap fetch; porstnap extract