Unix

Unix File System and File Types

All data in UNIX is organized into files. All files are organized into directories. These directories are organized into a tree-like structure called the file system. A family tree is an example of a hierarchical structure that represents how the UNIX file system is organized. The UNIX file system might also be envisioned as an inverted tree or the root system of plant.
At the very top of the file system is single directory called "root" which is represented by a / (slash). All other files are "descendents" of root.

Types of Unix file system

The unix file system contains  different types of files.
Ordinary Files 
  • Used to store your information, such as some text you have written or an image you have drawn. This is the type of file that you usually work with.
  • Always located within/under a directory file
  • Do not contain other files
Directories
  • Directories store both special and ordinary files.
  • Branching points in the hierarchical tree
  • Used to organize groups of files
  • May contain ordinary files, special files or other directories
  • Never contain "real" information which you would work with (such as text). Basically, just used for organizing files.
  • All files are descendants of the root directory, ( named / ) located at the top of the tree.
Special (or) Device Files
  • In Unix, almost all things are handled as files and have a location in the file system—even hardware devices like hard drives. The great exception for devices and the files that represent them are network devices that do not turn up in the file system but are handled separately. 
  • Device files are used to apply access rights and to direct operations on the files to the appropriate device drivers.
  • Unix makes a distinction between character devices and block devices. The distinction is roughly as follows:
                              a)character devices provide only a serial stream of input or output
                              b)block devices are randomly accessible
  • For example, disk partitions may have both character devices that provide unbuffered random access to blocks on the partition and block devices that provide buffered random access to blocks on the partition. 
Pipes
  • UNIX allows you to link commands together using a pipe. The pipe acts a temporary file which only exists to hold data from one command until it is read by another.

Powered by Blogger.