Gentoo:Directory structure
From Linux 101, The beginner's guide to all things Linux.
Gentoo's directory structure follows the standards set forth in the Filesystem Hierarchy Standard (FHS). The following information is taken from the Gentoo Handbook with modifications to more accurately reflect the FHS and provide more information.
/ (The root of the filesystem, beginning of the hierarchy) +- bin/ (Executable programs needed to get the system up and running) +- boot/ (Files related to the boot loader and Linux kernel) +- dev/ (Special or Device files) +- etc/ (Configuration files) +- home/ (User home directories, Optional) +- lib/ (Libraries needed to get the system up and running) +- mnt/ (Location for mount points, some distributions utilize media/ instead) +- opt/ (Contains large package installations not part of a regular install) +- proc/ (Kernel-provided information) +- root/ (Home directory for the root user, Optional) +- sbin/ (System administration executables to get the system up and running) +- sys/ (Kernel-provided information) +- tmp/ (Temporary files) +- usr/ (Applications for day-to-day system usage) `- var/ (Variable information like log-files, caches, ...)
[edit] Directories of interest
There are a number of directories which are (more or less) Gentoo-specific and are worth knowing.
- /usr/portage: This directory is where the ebuilds and portage metadata is stored. Some people also utilize this directory for storing overlays.
- /usr/portage/distfiles: Within the portage directory is the distfiles directory. Within this you will find the source code downloaded during an emerge to be extracted and compiled. This is most likely a major space user. It is completely safe to remove all files within this directory, however, you will be required to download the source code for any programs you wish to re-emerge. This will not only waste your bandwidth, but also the bandwidth of the Gentoo servers. If you can spare the space, it is recommended that you not delete files within here. Keeping the current source code for a program saves time and energy for both you and the servers hosting the files.
- /var/tmp/portage: This is the directory into which portage will extract the source code of the program for compilation. Once finished compiling, it will remove the source code as well as compiled code, but leave the logs. These files are also completely safe to remove, but can easily aid in diagnosing issues you may have with an ebuild or emerged program. Due to the relatively small size of this directory, it is recommended you not remove files within here unless you are very low on space or know you no longer need them.
- /etc/init.d: This directory stores scripts for manipulating the states of devices and services on the system. These scripts are added to various runlevels through the use of the rc-update command. For the most part, the scripts are simply used to start or stop a service/device, but a few have more advanced commands available to them.
| Navigation: Gentoo Index |

