nextuppreviouscontents
Next:EditorsUp:Linux Tutorial Previous:Command description

File Structure

The original Unix system have inspired a large number of platforms still in use or gone into oblivion. MS-DOS has taken features from UNIX. Therefore, Linux share similarities with DOS. Take one minute to compare the semblance of the command line interface and thefile system look with all major OS.

However, the Linux scripting may differ slightly from one distribution to the other (e.g.RED HAT and Slackware). The explanation to this goes back to the late 70's. During that time, its original distributor -AT&T- was banned from making commerce in the area of computing. As a result, the software was licensed to third parties to work on the development and distribution. The original Unix created at Bell labs was sold to Universities and it was named either BSD (for Berkeley System Design) or System V. Half of Linux packages is BSD based.

The major distributions like Red Hat and Debian are based on system V boot sequence. This may cause confusion for those who are shifting from one distributor to another because some files look misplaced. The most common directories are /bin, /root, /usr, /tmp, /lost+found, /mnt, /lib, /boot, /dev, /home. The directory hierarchy for BSD looks like this:

/bin/cdrom/etc/lib/mnt/proc/sbin/tmp/var

/boot/dev/home/lost+found/opt/root/usr*vmlinuz

Linux supports up to 256 character file names honoring its 32-bites nature. It is case sensitive. It can accept space between two or more sentences like "Tux the Penguin.html" within the GUI. However, the shell the command line is unable to invoke those files or directories. This shell interprets this name as Tux\ the\ Penguin instead and it should be invoked as such. Otherwise, press tab after typing Tux so Linux could complete the sentence automatically. The most common thing to do is to place an underscore when creating long file names.

The file system supports multi-user capabilities. That means that many people can login either directly or remotely. The user information is stored in the home directory. A new directory is created for each new user. This directory holds permissions to save and manipulate files only within the user's own directory. To add a new user just type adduser at the command line and follow the instructions.

Here is a brief description of the directories outlined above as well as the files they often contain.


bin

It contains the essential binaries to run the system. Most care is advised when logged as root. Since only root have the right to delete files, one could wipe out one or all the files by accident.

boot

Essentially, the directory boot contains binaries that determine the booting process of the kernel.

cdrom

This is the mount point for the CD-ROM. The command line is mount /dev/cdrom /cdrom. Also, it could mount as mount -r -t -iso9660 /dev/hdc /mnt

dev

This directory houses an infinite number of files representing the hardware devices. Them most common are fd0 for floppy A drive. Hda1 for the first partition of an IDE hard drive set as master. SCSI is represented as sda1. Slaves are hdb or sdb.The first ethernet card is eth0. The mouse is ttyS0.

etc

All the administration, system and configuration files are saved in the etc directory.

home

This stores the user account information and related issues like what applications the user may run.

lib

The shared libraries that make the programs run are stored in the lib directory.

lost+found

It does not contain any file by default. Most possibly is a place to store temporary files.

mnt

This is the de-facto mount point for file systems. The most frequent device mounted is the floppy disk. The command line is mount /dev/fd0 /mnt -t enter the file system type

opt

Another mount point for file systems like /mnt.

proc

This mount the proc file system. Some files contains information relevant to the hardware address and IRQ.

root

It stores the databases which record the live and miracles of the programs that are running in the form of databases.

Most of this files are hidden because their name is preceded by a dot. To view them just type ls -a


sbin

This directory contains the system administration binaries. Here are located commands like adduser, ext2.fsck,makebootdisk, badblocks and liloconfig.

tmp

A repositorium for core files and irrelevant data.

usr

The directory where the programs, documents, manuals and HOWTOs are installed.

/usr/bin stores the standard programs and /usr/local the nonstandard ones.


var

A directory to store program databases and the laying ground for the Apache Web server.

vmlinux

This is the kernel. It is known by names like zimage or bzimage.

nextuppreviouscontents
Next:EditorsUp:Linux Tutorial Previous:Command description