Files and Directories

Although you're most interested in files in your own folder or directory, it helps to know what else is on your system. In this chapter we'll look around a GNU/Linux system.

Here is a diagram showing some of the common directories right beneath the root directory (the one whose name is just "/"):

/bin     basic programs (Programs that are absolutly needed, shell and commands only)
/boot    initialization files (Required to actually boot your computer)
/dev     device files (Describe physical stuff like hard disks and partitions)
/etc     configuration files
/home    users' home directories
/lib     basic libraries (Required by the basic programs)
/media   mount points for removable media
/mnt     mount points (For system admins who need to temporarily mount a filesystem)
/opt     third-party programs
/proc    proc filesystem (Describe processes and status info, not stored on disk)
/root    system administrator's files
/sbin    basic administration programs (Like bin, but only usable by administators)
/srv     service-specific files
/sys     sys filesystem (Similar to proc, stored in memory based filesytem: tempfs)
/tmp     temporary files (Files not kept between boots, often in tempfs)
/usr     most programs (Another bin, etc, lib, sbin, but for less important files)
/var     varible data (Similar to tmp, but preserved between reboots

Most of the time you don't need to know about the directory structure outside your home directory, but this knowledge occasionally comes in handy. Perhaps the most common uses are when you want to change a system-wide configuration file or view log messages, which record things going on and may reveal the source of problems on your system. (Log messages are usually found in the /var/log directory.)

Historically, GNU/Linux system configuration was done through editing text files. Today, most popular GNU/Linux systems encourage users to make changes to the system configuration through graphical administration tools. Sometimes however, this is not possible or desirable, and you may find yourself editing the configuration files in a text editor. This is usually trickier, as you need to know where these files are and how to edit them, and in some cases you also need to signal or restart a running program so it will read in your changes. That said, this method has its advantages, such as the ability to configure computers with no graphics capabilities, or configure programs that have no graphical configuration program.