Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web

Unix tutorials   
Freebsd and Linux documentation   





 

 

 

 

Unix file system

The Unix file system looks like an inverted tree structure. You start with the root directory, denoted by, at the top and work down through sub-directories underneath it.



Each node is either a file or a directory of files, where the latter can contain other files and directories. You specify a file or directory by its path name, either the full, or absolute, path name or the one relative to a location. The full path name starts with the root, /, and follows the branches of the file system, each separated by /, until you reach the desired file, e.g.:

/home/condron/source/xntp

A relative path name specifies the path relative to another, usually the current working directory that you are at. Two special directory entries should be introduced now:

. the current directory

.. the parent of the current directory

So if I'm at /home/frank and wish to specify the path above in a relative fashion I could use:

../condron/source/xntp

This indicates that I should first go up one directory level, then come down through the condron directory, followed by the source directory and then to xntp.

 

Unix Directories

Every directory and file is listed in its parent directory. In the case of the root directory, that parent is itself. A directory is a file that contains a table listing the files contained within it, giving file names to the inode numbers in the list. An inode is a special file designed to be read by the kernel to learn the information about each file. It specifies the permissions on the file, ownership, date of creation and of last access and change, and the physical location of the data blocks on the disk containing the file.

The system does not require any particular structure for the data in the file itself. The file can be ASCII or binary or a combination, and may represent text data, a shell script, compiled object code for a program, directory table, junk, or anything you would like.

There's no header, trailer, label information or EOF character as part of the file.

 

© 2003 unix-tutorials.8m.com