Home of Rob
Menu
The Linux Filesystem
This link takes you to the 'Filesystem Hierarchy Standard' and details how a filesystem should be setup for Unix systems. I therefore advise you to check it out if you're after a detailed overview of the Linux filesystem.
If you're looking for a simpler, quite brief explanation, though, stick around!
Introduction
Your harddrive is mounted on /, which means that everything is accessible via /. For example, other hard-drives and cd-roms etc. are generally accessible via /media. Within this root filesystem are various folders that are alwyas present (or will be for a properly working system) and I'll aim to cover each of them briefly here.
| Folder | Comment | Should I fiddle? |
| /bin | This folder contains binaries - specifically, those essential for the system to operate. | Nope. |
| /boot | This folder holds files that the system uses when booting the operating system. | Certainly not! |
| /dev | Device drivers are generally put in here, for example COM ports. | Not generally, but won't break things that much. |
| /etc | Configuration files. This contains files required for system setup, including the hosts file, network settings, graphics settings and all the background processes that run (in /etc/init.d, launched from /etc/rc*) | Only if you know what you're doing. When setting things up (servers, daemons for example), you'll need to change things in here. Otherwise avoid it. |
| /lib | Shared libraries and kernel libraries go in here. | No. Removing files from here will stop programs from working. When you install software, it should automatically place things in this folder (if required). |
| /home | User files! | Oh yes! This is where you should store everything. You've got complete write-access to this part, so frolic away! |
| /media | Mount point for removable media. |
You can mess around in here if you want, but it should _only_ be used for mounting removable media (USB keys, CD-ROM drives etc.). And if you remove directories, your devices won't auto-mount after that. Note: settings for auto-mount are stored in /etc/fstab |
| /mnt | Mount point for filesystems, when mounting on a temporary basis. | Sure, whenever you need to mount a filesystem feel free to do it in here. |
| /opt | Apparantely, it's for add-on application for software. I've never used it. | No, don't think so. |
| /sbin | Essential system binaries. | Don't even think about it. |
| /tmp | Temporary files | No. Files in here are liable to be removed without asking you first, so don't do anything in here. |
| /usr | A secondary filesystem... | Yes, but be careful (see below) |
| /var | This stores system files that change regularly. For example, /var/log contains log files. | No. Read-only, is my recommendation. |
/usr
The /usr folder contains another filesystem hierarchy within it. For example, there's /usr/sbin (more system binaries - don't touch these) and /usr/lib (libraries).
Often-times software will install itself in this folder. It's a good place to check if you're not sure where software has gone. If you want to install software to be used by many different users of the system you can put it in /usr/share. Java usually installs into here aswell (/usr/java).