We will now examine some of the most common directories you will find in most UNIXes.
The /bin Directory
This directory contains the binaries or executable programs which are needed to start the system and other essential system functions. This directory holds programs that all users will need to access in order to use the UNIX box.
For example, you will usually find the various shells in /bin (such as /bin/sh and /bin/tcsh). You will also find most of the command line utilities which we have mentionned thus far in there (such as /bin/ls, /bin/ps and /bin/cp).
The /boot Directory
This is the directory that normally contains the boot-loader for the machine and the operating system kernel.
The /dev Directory
Files in the /dev directory reference system devices. They access system devices and resources such as hard disks, the mouse, printers, consoles, modems, memory, floppy disks, ethernet cards, and the CD-ROM drive. UNIX systems include many device files in the /dev directory to accomodate seperate devices attached to the computer. These device files are divided into major classifications:
block types: which indicates that the device transfers data as a block of characters
character types: which indicates that the device transfers data as a serial flow of characters.
Explanation of some of the items in this directory can be found at the bottom of page 43 in the book. (Look at it now).
The /etc Directory
The /etc directory contains configuration files for the system and system resources (such as services). Most of this directory is reserved for the system administrator and contains files critical to the operation of the system.
We will examine the contents of this directory in gratuitous detail as the rest of these courses proceed, but you can see a preview of the contents of /etc on page 44 of the book (Look at it now).
The /lib Directory
This directory houses kernel modules (which are like drivers for the Linux kernel), security information, and shared libraries for the entire system.
The /mnt Directory
This is where you can have additional mount points for other filesystems and devices. You will usually find the mount points for the CD-ROM and floppy drives here. NOTE: Some UNIX and Linuxes do not use the /mnt directory structure.
The /proc Directory
This directory does not actually exist on your hard drive. It is what is known as a virtual file system and exists in system memory only. Files in the /proc file system refer to the various processes running on the system. When you issue the 'ps' command, it reads its information from /proc.
/proc has many powerful uses and features which we will touch on in this course, and will return to examine in more detail in UNIX03.
The /sbin Directory
This directory contains binaries and executables for system administration. Typically, you will not have normal users running programs found in this directory.
The /tmp Directory
Many programs need a temporary place to store data while processing. The traditional location is the /tmp directory.
The /var Directory
We have already seen a glimpse at one of the uses for this directory tree, as a place for storing system logs. But it also stores things like spool files (such as mail and printer spool files) and may even store web-sites on some web-servers.
The /usr and /opt Directories
Underneath the /usr directorie is typically another directory tree mirroring the root directory. There you may find
/usr/bin
/usr/etc
/usr/lib
/usr/sbin
etc.
which will contain other executables, configuration files, libraries, etc. The purpose of the /usr directory is to store additional programs, configurations, libraries, etc that are not critical for system functioning, and are instead considered "supplimental" or "user" applications.
As an example, a Word Processor or Office Suite would typically go in here. You will also find things like system-wide icon sets, fonts, and other media.
The one problem arises in a difference of opinion between UNIX system administrators. Some admins prefer the directory /opt instead of /usr. Typically, these admins also prefer /opt to be more "freeform" (similar to what you have under Windows), which can really confuse things. Sometimes, these admins are also application developers who make /opt the "default" installation location for their programs (the most notable one is Open Office, which installs in the awful /opt/OpenOffice.org directory by default.)
Thus, it can be very easy for a UNIX or Linux install to get out of hand with a sysadmin who does not take care to keep things installed consistantly. Obviously, if you have half of your user applications installed in /usr and half in /opt, maintenance can get pretty difficult.