dpal on November 20th, 2005
One of the toughest things for a windows user to begin to understand is the Linux’s filesystem layout.
I thought I’d give a quick primer:
/ (aka:root) - The root directory is the base of the filesystem “tree”. It would be equivalent to C:\ in the windows world.
/boot - The boot directory may or may not be visible to the user once the OS has been booted since somtimes the directory can be unmounted after the boot process is complete. This filesystem consists of the all the things needed at system boot time. The OS kernel is usually located in this directory, but sometimes located in the root directory.
/bin - The bin directory contains essential user-command binaries. These are commands that can be used by any user, including the systems administrator. This area is meant specifically for commands needed when no other filesystems are mounted, as in when the system is in single-user mode. Other user-executable files can be found in /usr/bin, /usr/local/bin, or in /opt/[package]/bin
/dev - The dev directory is reserved for device files. For instance, references to devices such as /dev/hda - which is usually your ide hard drive, or /dev/sound - which usually contains iformation regarding your sound card, are often found in your system configuration files.
/etc - The etc directory is where almost all of your system-specific configuration files are found. No binaries are found here. For instance, the filesystems mounted at boot time can be found in /etc/fstab. You determine how mysql(if it’s installed) behaves by editing /etc/my.cnf. Your users, their passwords(well, sort of), home directories, and their default shell are all stored in /etc/passwd.(Their encrypted password is usually in /etc/shadow) Note:Please take extreme caution when editing any of these files. The slightest typo to one of these files can cause very unexpected results!
/home - The home directory is where user home directories(except root, whose home directory is usually either /root or /) are kept. Normally, when you log in, you begin in your home directory(eg:user foo would begin in /home/foo). This is a basic repository for your(the user) convenience. You can keep documents, downloads, pictures, etc. here. Also located here are user-specific configuration files. These files ( also known as “dot” files) contain user-specific prefernces for how they may want a particular application to behave. Mysql will look at /etc/my.cnf and then look at /home/foo/.my.cnf for configuration preferences whenever it is called. These “dot files” are not visible to the normal user via the normal ls command, but can be found by doing an “ls -a”.
/lib - The lib directory contains shared libraries for applications and kernel modules as well.
/opt - The Opt directory is reserved for add-on packages or third-party packages.
/sbin - sbin contains system binaries that are needed for booting, restoring, or recovering the system. Other sysadmin utilities can be found in /sbin, /usr/sbin, or /usr/local/sbin.
/tmp - the tmp directory is a repository for applications that require temporary files.
/usr - /usr is a very complex directory structure and is maybe a little too in-depth for this article. the /usr directory is usually broken down in to many sub-directories:
/usr/lib - application libraries for binaries found in /usr/bin and /usr/sbin
/usr/local - This is a repository for locally installed binaries
/usr/include - contains C header files
/usr/share - files are not archetecture specific
/usr/bin - contains most user commands
/usr/sbin - system administration commands
/usr/src - source code. Your kernel source files can be found in /usr/src/linux
/var - also quite complex is the var directory strucure. I will attempt to explain a few of the subdirectories:
/var/cache - application cache data
/var/lib - variable state information
/var/log - here is the meat of the /var filesystem. System and application logs are here
/var/spool - application spool data
/proc - This directory is for kernel and process information
Well, that should get you started. If you need to know more about the filesystem directory structure, there is a standards document on the web specifically for this. Their document is much more complete(and maybe more accurate) than what I provided here, but my purpose was to get you familiar with your surroundings before flying head-first into the unknown. As always, if you have any questions, leave a comment and I will attempt to answer as best I can.
Tags: gnome, Linux, software, Technology
Leave a Reply