Paths under Linux ~~~~~~~~~~~~~~~~~ Every program and package installed on a Linux system is installed into a particular 'prefix'. The main places are: / This contains the base system. The basic tools needed to boot the system and bring it up and running are stored here. The idea here is that you can have a "boot" partition which is separate from the rest of the system. If something catastrophic happens, there are enough tools here to boot up and recover the system. /usr This contains the rest of the system. Most programs get installed in here. Note that /usr is for programs installed by the package management system (rpm, apt-get, dpkg); if you compile something yourself, it is put in /usr/local. /usr/X11R6 The X Window System is installed here. This only applies to X itself; most graphical applications are installed in /usr. This is becoming less relevant over time, and some distributions now just install X in /usr. /usr/local This contains programs that have been manually installed (not by the package manager). If you compile and install something yourself, it is usually put here. The idea here is that you can backup your system by saving the contents of /usr/local, and ignore the rest of /usr to save space. /opt/(pkgname) Packages sometimes want their own completely separate prefix and are installed here. For each prefix, there are a number of subdirectories: (prefix)/bin This contains programs that normal users can run (.exe files under Windows) (prefix)/games Games are installed in a separate directory to other programs. Some systems just put everything into bin. (prefix)/sbin This contains programs that are intended for only the system administrator to run. Some of these can still be run by normal users, though (like /sbin/ifconfig) (prefix)/include C header files. (prefix)/lib This contains library files (.dll files under Windows) (prefix)/lib64 64-bit libraries. This allows 32-bit and 64-bit programs to co-exist on a system together. (prefix)/share (prefix)/share/(name) contains data files used by the program/package named (name). Various other data files are also stored here: /usr/share/pixmaps often contains shared image files, for example. (prefix)/share/doc Similar to (prefix)/share, documentation for a program named 'progname' will be stored in (prefix)/share/doc/progname. Extra directories do not belong in a prefix and are: /boot OS kernels and bootloader configuration files are stored here. /dev Device files representing physical devices on the system. /etc System configuration files /home Users have home directories in /home/(user name) in which they can store their documents, etc. /lost+found If the filesystem is corrupted, the fsck(8) tool can be used to recover the system. If a file is recovered but has no name, it is placed here. /media Removable drives (floppy drives, CD-ROM drives) are mounted in here. /mnt Other mounts are mounted here (hard drives, NFS shares, etc) /proc Virtual process filesystem. There is a directory here for each running process on the system, along with other files with useful information about the system. /root root (the super user) has its home directory in /root, rather than in /home with everyone else. The idea here is that /home can be mounted separately from the rest of the system, but root's home directory is on the boot partition and is therefore always available in case it is neccessary to recover the system. /sys Information about kernel objects is available in here under Linux 2.6. /tmp Temporary files are stored in here. /usr/src Program source code. /var Files which may change are stored in here. The idea here is that /usr can be mounted as read-only (eg. from an NFS share) to make the system more secure. Examples of things found in here are log files (/var/log), program cache files (/var/cache) and mail files (/var/mail). Windows Analogies (roughly): /etc The registry /home C:\Documents and Settings /lib /usr/lib C:\Windows\System32 /usr/local/lib /media Different drive letters /mnt /opt C:\Program Files /tmp C:\Windows\Temp