4.5. Directory Structure

The FreeBSD directory hierarchy is fundamental to obtaining an overall understanding of the system. The most important directory is root or, /. This directory is the first one mounted at boot time and it contains the base system necessary to prepare the operating system for multi-user operation. The root directory also contains mount points for other file systems that are mounted during the transition to multi-user operation.

A mount point is a directory where additional file systems can be grafted onto a parent file system (usually the root file system). This is further described in Section 4.6, “Disk Organization”. Standard mount points include /usr/, /var/, /tmp/, /mnt/, and /cdrom/. These directories are usually referenced to entries in /etc/fstab. This file is a table of various file systems and mount points and is read by the system. Most of the file systems in /etc/fstab are mounted automatically at boot time from the script rc(8) unless their entry includes noauto. Details can be found in Section 4.7.1, “The fstab File”.

A complete description of the file system hierarchy is available in hier(7). The following table provides a brief overview of the most common directories.

DirectoryDescription
/Root directory of the file system.
/bin/User utilities fundamental to both single-user and multi-user environments.
/boot/Programs and configuration files used during operating system bootstrap.
/boot/defaults/Default boot configuration files. Refer to loader.conf(5) for details.
/dev/Device nodes. Refer to intro(4) for details.
/etc/System configuration files and scripts.
/etc/defaults/Default system configuration files. Refer to rc(8) for details.
/etc/mail/Configuration files for mail transport agents such as sendmail(8).
/etc/namedb/named(8) configuration files.
/etc/periodic/Scripts that run daily, weekly, and monthly, via cron(8). Refer to periodic(8) for details.
/etc/ppp/ppp(8) configuration files.
/mnt/Empty directory commonly used by system administrators as a temporary mount point.
/proc/Process file system. Refer to procfs(5), mount_procfs(8) for details.
/rescue/Statically linked programs for emergency recovery as described in rescue(8).
/root/Home directory for the root account.
/sbin/System programs and administration utilities fundamental to both single-user and multi-user environments.
/tmp/Temporary files which are usually not preserved across a system reboot. A memory-based file system is often mounted at /tmp. This can be automated using the tmpmfs-related variables of rc.conf(5) or with an entry in /etc/fstab; refer to mdmfs(8) for details.
/usr/The majority of user utilities and applications.
/usr/bin/Common utilities, programming tools, and applications.
/usr/include/Standard C include files.
/usr/lib/Archive libraries.
/usr/libdata/Miscellaneous utility data files.
/usr/libexec/System daemons and system utilities executed by other programs.
/usr/local/Local executables and libraries. Also used as the default destination for the FreeBSD ports framework. Within /usr/local, the general layout sketched out by hier(7) for /usr should be used. Exceptions are the man directory, which is directly under /usr/local rather than under /usr/local/share, and the ports documentation is in share/doc/port.
/usr/obj/Architecture-specific target tree produced by building the /usr/src tree.
/usr/ports/The FreeBSD Ports Collection (optional).
/usr/sbin/System daemons and system utilities executed by users.
/usr/share/Architecture-independent files.
/usr/src/BSD and/or local source files.
/var/Multi-purpose log, temporary, transient, and spool files. A memory-based file system is sometimes mounted at /var. This can be automated using the varmfs-related variables in rc.conf(5) or with an entry in /etc/fstab; refer to mdmfs(8) for details.
/var/log/Miscellaneous system log files.
/var/mail/User mailbox files.
/var/spool/Miscellaneous printer and mail system spooling directories.
/var/tmp/Temporary files which are usually preserved across a system reboot, unless /var is a memory-based file system.
/var/yp/NIS maps.

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <[email protected]>.
Send questions about this document to <[email protected]>.