Important Files and Folders

Important Files

/etc/profile
Systemwide defaults, mostly setting the environment (all Bourne-type shells, not just Bash [1])
/etc/bashrc
Systemwide functions and aliases for Bash
$HOME/.bash_profile
User-specific Bash environmental default settings, found in each user's home directory (the local counterpart to /etc/profile)
$HOME/.bashrc
User-specific Bash init file, found in each user's home directory (the local counterpart to /etc/bashrc). Only interactive shells and user scripts read this file. See TODO Appendix M for a sample .bashrc file.
$HOME/.bash_logout
User-specific instruction file, found in each user's home directory. Upon exit from a login (Bash) shell, the commands in this file execute.
/etc/passwd
A listing of all the user accounts on the system, their identities, their home directories, the groups they belong to, and their default shell. Note that the user passwords are not stored in this file, but in /etc/shadow in encrypted form. [2]
/etc/sysconfig/hwconf

Listing and description of attached hardware devices. This information is in text form and can be extracted and parsed.

bash$ grep -A 5 AUDIO /etc/sysconfig/hwconf
class: AUDIO
bus: PCI
detached: 0
driver: snd-intel8x0
desc: "Intel Corporation 82801CA/CAM AC'97 Audio Controller"
vendorId: 8086

Note: This file is present on Red Hat and Fedora Core installations, but may be missing from other distros.

Important System Directories

Sysadmins and anyone else writing administrative scripts should be intimately familiar with the following system directories.

/bin
Binaries (executables). Basic system programs and utilities (such as bash).
/usr/bin
More system binaries. [3]
/usr/local/bin
Miscellaneous binaries local to the particular machine.
/sbin
System binaries. Basic system administrative programs and utilities (such as fsck).
/etc

Et cetera. Systemwide configuration scripts.

Of particular interest are the /etc/fstab (filesystem table), /etc/mtab (mounted filesystem table), and the /etc/inittab files.

/etc/rc.d
Boot scripts, on Red Hat and derivative distributions of Linux.
/usr/share/doc
Documentation for installed packages.
/usr/man
The systemwide manpages.
/dev
Device directory. Entries (but not mount points) for physical and virtual devices. See TODO Chapter 29.
/proc
Process directory. Contains information and statistics about running processes and kernel parameters. See TODO Chapter 29.
/sys
Systemwide device directory. Contains information and statistics about device and device names. This is newly added to Linux with the 2.6.X kernels.
/mnt

Mount.

Directory for mounting hard drive partitions, such as /mnt/dos, and physical devices. In newer Linux distros, the /media directory has taken over as the preferred mount point for I/O devices.

/media
In newer Linux distros, the preferred mount point for I/O devices, such as CD/DVD drives or USB flash drives.
/var

Variable (changeable) system files.

This is a catchall "scratchpad" directory for data generated while a Linux/UNIX machine is running.

/var/log
Systemwide log files.
/var/spool/mail
User mail spool.
/lib
Systemwide library files.
/usr/lib
More systemwide library files.
/tmp
System temporary files. All files here are deleted at boot time.
/boot

System boot directory.

The kernel, module links, system map, and boot manager reside here.

Warning: Altering files in this directory may result in an unbootable system.

[1]This does not apply to csh, tcsh, and other shells not related to or descended from the classic Bourne shell (sh).[2]In older versions of UNIX, passwords were stored in /etc/passwd, and that explains the name of the file.[3]Some early UNIX systems had a fast, small-capacity fixed disk (containing /, the root partition), and a second drive which was larger, but slower (containing /usr and other partitions). The most frequently used programs and utilities therefore resided on the small-but-fast drive, in /bin, and the others on the slower drive, in /usr/bin. This likewise accounts for the split between /sbin and /usr/sbin, /lib and /usr/lib, etc.