Web Developer, Web Development, Software Development, System Administration Tools Resouce, Articles Resouce, Content Resouce, Information Resouce
Articles and Tools for Web Developers, Web Development, Software Development, System Administration
Introduction to the Linux,Unix,*nix File System

Windows users will be lost when trying to accomplish many tasks on linux. Although many improvements have been made over the years to provide a better GUI for users on workstations and home users of PC's, they are still in their infancy providing only a limited amount of control and access over the system. Almost all major server applications require complex command line calls and text editing of configuration files as opposed to the kinder windows gui's. Below is a listing of the standard operating systems file structure for Linux and Unix (*nix refers to all the flavors and versions of Unix and Linux).
Directory Description
/bin (Binaries - Program Files)
/boot (Bootup related)
/dev (Device)
/etc (Configuration)
/home (User Documents)
/lib (Program Libraries)
/lost+found (Recovered files)
/mnt (Mount)
/opt (Optional - not really used much in linux)
/proc (Process - Virtual Directory)
/sbin (System Binaries-System Programs)
/usr (User)
/root (Administrator, root user directory)
/tmp (Temporary)
/var (Variable)
First thing you will notice is that you have no drive letter, the highest level directory is slash ("/") under which all the other directories fall. Second you will notice that all the files are listed under their functional parts as opposed to having a single directory for each program you will have a directory in several of these folders for each segment of the programs anatomy.

/bin
Binaries also known as programs (ie. program files) are located here. They are available for use by pretty much all users, but they are not required for the system to run (as fundamental as they might be) programs here include mv (move), cp (copy), rm (remove) and many more.

/boot
Required for the systems bootup operations. You will find the system kernel, system map, and lilo boot sector backups here.

/dev
All the devices are here. On linux systems you will note that everything represented as a directory or file. CD-Roms (/dev/CD-ROM), Floppies (/dev/fd0, /dev/fd1, /dev/fd2, etc.), and hard drives (/dev/hda1,/dev/hda2, etc.) are here. Most devices are listed under here with their device type listed as a dub directory with a number appended at the end (0 and up). Hard drives are often noted as "type, letter, number" where the letter represents the partition. SCSI drives are /dev/sda0 (first SCSI drive first partition), IDE are /dev/hda0 (first IDE drive first partition), COM ports are /dev/ttyS0 (COM port 1), etc.

/etc
This is where you will find the built of the configuration files on your system. Often times each major program creates its own subdirectory here.

/home
Since Unix, linux, and other *nix environments were designed to handle multiple users at once, each user has their own directory for their own files to contain user specific configurations, documents, etc.

/lib
Shared libraries similar to windows dynamic libraries for use by programs/binaries are stored here.

/lost+found
Files that are recovered, or partially recovered show up here.

/mnt
This folder is the "mount point" for your processes. Within it you will find sub directories where you can mount your CD-Roms, DVD players, floppy disk drives and

/opt
This is a directory for add on packages not part of the original installation. It is nearly nonexistent in linux where you would look in /bin/program for it.

/proc
The Process directory, it is a pseudo directory that exists in virtual memory. It keeps track of your systems real time CPU usage, Disk Usage, network traffic, etc.

/sbin
Also known as system binaries, this directory contains the vital operating system files required for the OS to run. Nearly all programs listed in this directory are required by all users. A similar directory called /usr/sbin contains system admin programs such as daemons (in windows called "services") which are important, but not required for file system repairs or maintenance.

/usr
All the user binaries are here such as FTP, telnet, SSH, and X.

/root
This is basically the administrative user directory. In *nix systems the Administrator is called root (aka. Super User). This user has full privileges to all files on the operating system.

/tmp
Used for locked files and temporary data storage. Often deleted at shutdown and startup.

/var
Variable files are found here, most notably system logs (/var/log/messages/) batch operations (/var/spool/at/), httpd & DNS cached data (/var/www/ and /var/named respectively) and mail (/var/spool/mail or /var/mail) are usually found here.

More Information:
  • No defragmentation needed. You do not need to defrag your system due to the core structure of how it is designed and how the file system is organized. There are a few defragmenters available which offer very minor and temporary performance increases.
  • chkdsk (check disk) in windows is fsck (file system check) in Unix, Linux, and *nix file systems. There is also a subset of tools such as e2fsck, e3fsck, fsck.ext2, fsck.ext3, etc. Unlike windows systems which require scanning the file system regularly for errors (not so much though with NTFS in windows 2000/XP/2003), fsck is automatically called when needed from my experience.
  • Unified File System in *nix versus Windows Partitioned File System. This may seem odd at first, but it lets you have a great deal of strength and flexibility in Unix and Linux. The primary goal was so that you could add a hard drive from an existing system with programs installed on it and have it be portable to other file systems. Although this is computer friendly, I believe it to be one of the major drawbacks as well since people think from an object oriented perspective when organizing tasks, as opposed to a task oriented perspective.
  • Organized by Functionality in *nix versus Organized by Logical Drive Windows (and not Unix) broke convention by organizing file structure in relevance to the folders mentioned above under the Unified file system. This means that you files are located in relevance to their functionary roles as a distance from the root (aka "/") instead of drive letters. I believe that this makes keeping track of where files are located more difficult for windows users, but I also believe that it is very important when considering issues of portability.
Computer Consulting, System Administration, Methodology, Resume, Project, Management, Software, Development, Documentation, Articles Copyright 2003-2005 Avitar.net. Avitar.Net TM. All Rights Reserved. web development Consulting for System Administration Methodology Resume Project Management Software Development Documentation Web Developer