CompTIA Linux+ 4.5 Important Directories and Their Contents

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

/boot:

The /boot directory contains static and unshareable files related to the computer's initial booting. Higher-level startup and configuration files reside in another directory, /etc. In this directory, you will find GRUB or LILO configuration files along with the other files necessary for the initial boot. Typically, it is recommended that you store /boot on its own partition.

/dev:

Because Linux treats most hardware devices as if they were files, the OS must have a location in its filesystem where these device files reside. The /dev directory is that place. It contains a large number of files that function as hardware interfaces. If a user has sufficient privileges, that user may access the device hardware by reading from and writing to the associated device file. The Linux kernel supports a device filesystem that enables /dev to be an automatically created virtual filesystem—the kernel and support tools create /dev entries on the fly to accommodate the needs of specific drivers. Most distributions now use this facility.

/:

Every Linux filesystem traces its roots to a single directory, known as / (pronounced, and often referred to, as the root filesystem or root directory). All other directories branch off this one. Linux doesn't use drive letters. Instead, every filesystem is mounted at a mount point within another partition (/ or something else). Certain critical subdirectories, such as /etc and /sbin, must reside on the root partition, but others can optionally be on separate partitions. Don't confuse the root directory with the /root directory, described shortly.

/mnt:

Linux mounts removable-media devices within its normal directory structure, and /mnt is provided for this purpose. Some (mostly older) distributions create subdirectories within /mnt, such as /mnt/cdrom, to function as mount points. Others use /mnt directly or even use separate mount points off /, such as /cdrom. The FHS mentions only /mnt; it doesn't specify how it's to be used. Specific media mounted in /mnt may be either static or variable. As a general rule, these directories are shareable.

/tmp:

Many programs need to create temporary (hence variable) files, and the usual place to do so is in /tmp. Most distributions include routines that clean out this directory periodically and sometimes wipe the directory clean at bootup. The /tmp directory is seldom shared. Some administrators create a separate /tmp partition to prevent runaway processes from causing problems on the root filesystem when processes create too-large temporary files. A similar directory exists as part of the /var directory tree (/var/tmp).

/etc:

The /etc directory contains unshareable and static system configuration files. These higher-level startup and configuration files control the various programs and services offered on a system. For example, if the Linux distribution uses systemd system initialization, some systemd configuration files are stored in /etc/systemd directories. If the Linux distribution uses SysV system initialization, its configuration files are stored in /etc directories.

/bin:

This directory contains certain critical executable files, such as ls, cp, and mount. These commands are accessible to all users and constitute the most important commands that ordinary users might issue. You won't normally find commands for big application programs in /bin. The /bin directory contains static files. The directory is almost never shared—any potential clients must have their own local /bin directories.

/usr/local:

This directory contains subdirectories that mirror the organization of /usr, such as /usr/local/bin and /usr/local/lib. The /usr/local directory hosts files that a system administrator installs locally—for instance, packages that are compiled on the target computer. The idea is to have an area that's safe from automatic software upgrades when the OS as a whole is upgraded. Immediately after Linux is installed, /usr/local should be empty except for some stub subdirectories. Some system administrators split this off into its own partition to protect it from OS reinstallation procedures that might erase the parent partition.

/var:

This directory contains transient files of various types—system log files, print spool files, mail and news files, and so on. Therefore, the directory's contents are variable. Some subdirectories are shareable, but others are not. Many system administrators put /var in its own partition, particularly on systems that see a lot of activity in /var, like major Usenet news or mail servers.

/home:

This directory contains users' data, and it's shareable and variable. Although the /home directory is considered optional in FHS, in practice it's a matter of the name being optional. For instance, if you add a new disk to support additional users, you might leave the existing /home directory intact and create a new /home2 directory to house the new users. The /home directory often resides on its own partition.

/usr:

This directory hosts the bulk of a Linux computer's programs. Its contents are shareable and static, so it can be mounted read-only and may be shared with other Linux systems. For these reasons, many administrators split /usr off into a separate partition, although doing so isn't required. Some subdirectories of /usr are similar to their namesakes in the root directory (such as /usr/bin and /usr/lib), but they contain programs and libraries that aren't absolutely critical to the computer's basic functioning.

/usr/X11R6:

This directory houses files related to the X Window System (X for short), Linux's GUI environment. Like /usr/local, this directory contains subdirectories similar to those in /usr, such as /usr/X11R6/bin and /usr/X11R6/lib. Although commonly used several years ago, most modern distributions have moved the contents of this directory to others, such as /usr/bin.

/media:

This directory is an optional part of the FHS. It's like /mnt, but it should contain subdirectories for specific media types, such as /media/dvd. Many modern distributions use /media subdirectories as the default mount points for common removable disk types, often creating subdirectories on the fly.

/lib:

This directory is similar to /bin and /sbin, but it contains program libraries. Program libraries consist of code that's shared across many programs and stored in separate files to save disk space and RAM. The /lib/modules subdirectory contains kernel modules—drivers that can be loaded and unloaded as required. Like /bin and /sbin, /lib is static and theoretically shareable, although it's not shared in practice.

/sbin:

This directory is similar to /bin, but it contains programs that are normally run only by the system administrator—tools like fdisk and e2fsck. It's static and theoretically shareable, but in practice it makes no sense to share it.

/opt:

This directory is similar to /usr/local in many ways, but it's intended for ready-made packages that don't ship with the OS, such as commercial word processors or games. Typically, these programs reside in subdirectories in /opt named after themselves, such as /opt/applix. The /opt directory is static and shareable. Some system administrators break it into a separate partition or make it a symbolic link to a subdirectory of /usr/local and make that a separate partition.

/usr/share/man:

This directory stores the manual pages used by the man command. Alternatively, any local manual pages are stored in the /usr/local/share/man directory. The various subdirectories store specific manual page sections. For example, /usr/share/man/man1 and /usr/local/share/man/man1 directories contain the user program (section 1) manual pages.

/proc:

This is an unusual directory because it doesn't correspond to a regular directory or partition. Instead, it's a virtual filesystem that's created dynamically by Linux to provide access to certain types of hardware information that aren't accessible via /dev. For instance, if you type cat /proc/cpuinfo, the system responds by displaying information about your CPU—its model name, speed, and so on.

/root:

This is the home directory for the root user. Because the root account is so critical and system specific, this variable directory isn't really shareable.


Ensembles d'études connexes

Ch.13 Viruses Viroids and Prions

View Set

Government Unit 1.1 (Intro to Gov)

View Set

BASIC VEHICLE TECHNOLOGIES 2: SAFETY

View Set

MICROECON Chapter 17 Hw questions

View Set

Final Exam Rotation #1 Study Guide

View Set

tfm #2: Elements of Narrative + Mis-en-Scene

View Set