File system.


This is a bit of a tricky one as I haven't really got my head round the Linux file system :o) Honesty is the best policy. Anyway, the most common file system under Linux is the ext2 file system (the reiserfs is also gaining in popularity). Linux can read other file systems like vfat & fat. To find out more about the ext2 & reiserfs there is a wealth of information on the internet.

Unlike the fat & vfat file systems used by Microsoft, ext2 is not limited to the 8+3 file name concept, & like Linux's Unix counterparts it is case sensitive! File names can be up to 255 characters long & are not allowed to have the "/" symbol in them ("/" being the separator for the path to a directory). There is no need to call a text file .txt because almost all files are text files & be read as a text file. Executable files are not called .exe, they are defined in their attributes as being executable (more to that in the permissions section). The way that you name & define your files names helps you to find the files easily, or to enable the files to be used by other machines. Your Linux machine doesn't care what the files are called (within reason), it handles the file according to the permissions & the content of the files.

Believe it or not everything on a Linux machine is a file, even hardware is kept & managed as a file! The monitor contents, the text & characters are a file, & can be converted into a readable text file. This concept that everything is a file can be well used to our advantage. Every process has 3 basic states, the standard input (stdin), standard output (stdout), & standard error (stderr). These states can be used to take certain parts of the information, for example the information displayed on the monitor screen, & turn that into a file. Take the example of a part of a script that I wrote to generate me a list of all the files & directories contained within a given "start directory", which is used as part of a script ("programme") to batch set up file permissions:

ls -R /home/user > /home/user/list.dat

The command ls -R ("list", or equivalent of dir) searches recursively (-R) through the given start directory & list the contents on the screen, but when we add the > we tell ls to redirect it's output into the file list.dat, i.e. instead of displaying it on the monitor write the output into a file. Very useful. More to this in the section "piping & redirecting".



back a page    back to main index    forward a page
copyright 2001 Rob Hawke.
rob@highasakite.net