- Regular or Ordinary Files
- Directory Files
- Device Files
- FIFO Files
Regular Files:These files usually consist of a sequential series of bytes and occupy space on the disk. They always form a leaf node in the tree hierarchy. They have no fixed format. Their format and structure is totally dictated by the utility that creates and accesses such files.These files can be created using editors like ed,ex, vi or from the standard input using 'cat>filename' command. An ordinary file can be a text file from a word processing package, a program written in any language of the shell etc.
Directory Files:A directory is just a tabular collection of files and subdirectories. The contents of a directory can be any number of ordinary files, device files and directory files. A directory file can be thought of as the branch of the Unix file system tree.Each directory has a name of normally upto 14 characters. Two or more files can have the same name if they are in different directories. It is only the kernel which can write a directory file. It is the kernel , which updates the corresponding directory file whenever a user adds or deletes a file from it. A user can only create directories, add or delete files from a directory ,or delete the directory itself.All the directories created by the user reside in the home directory of the user. The home directoryis assigned to the user when they are assigned a recognised login name. The user has complete control over the home directory; no one else except a privileged user can read or write files in it without the user's permission. The Unix system also maintains several directories for its own use.The structure of these directories is much the same on all Unix systems. These directories which include several important system directories, are located directly under the root directory.The root directory (designated by
/) is the source of the Unix file structure; all directories and files are arranged hierarchically under it.