We have already has a brief idea about the file System of the UNIX Operating System. Let us look at the basic features of the UNIX File System.
Features of UNIX File System: High Fy Study
It is like an inverted tree and follows a hierarchical, structure. We can remove the file system at any point of time. There is no restriction on the addition of files or file size, which can be dynamically increased or decreased. The files do not have a structure; they treat as stream of bytes. Files can be accessed simultaneously by many users at any given point of time.
Devices as well as directories are treated as Files in UNIX System. Every file is provided with permissions for access, so that the security is maintained. Each file is assigned an UNIQUE identification number by the operating system. This number is known as INODE number. Root is the main directory and heads the file system. It is represented by “/” (forward slash) unlike DOS where it is represented by backslash “/”. File paths are used for the search.
There can be two types of file paths, i.e. absolute path which gives the total path from the Root and Relative Path, which gives the path with respect to the current position. Directories in the path are separated by forward slash “/”. ‘. ’ represents current directory and ‘.. .’ represents parent directory.
UNIX File Types
Files under UNIX system can be classified as under depending on the data they hold. The functions they do: Ordinary files, Directory files, special files, FIFO file.
Ordinary File: These are the general files which are used for storing data, programs, text etc., one can add data to the file, delete data from the file, one can easily create these files using Editors, Word Processors, assemblers, compilers etc. when there is no need for the files, one can even delete these files without any problem. These are the most commonly created and used files.
Directory Files: We need to group all logically related files, as a matter of fact for easy search and identification. A directory is that file which holds the list of files and sub-directories under it. A directory file is also treated in the same way as an ordinary file; it also has a name, inode number and other information. Excepting certain operations, these files are quite similar to the ordinary files.
Special Files: UNIX treats all the peripheral devices as files. All these device files come under the category of special files also known as device files. These files represent Physical Devices. The operations to these files are as same as that of the ordinary files, only difference being, the reading or writing operations on these files activate the devices associated. These files are further classified depending on the way the data is handled as:
Character device files: These are those device files where the data is handled character by character during various operations on these device files. Terminals and printers usually come under this category, as they handle Data Character by Character.
Block device Files: These are those device file where the data is handled in large chunks known is block, during various operations unlike character device files data is handled character by character. Disks and Tapes came under this category as data is handled as blocks.
FIFO: Whenever two unrelated process have to communicate with each other, they do it with the help of FIFO files using Pipes. Here the path of the communication is unidirectional.
File Naming Convention: Education Topic Read
While naming the UNIX files, we have to follow certain basic convention which is as follows:
File names can be at most Fourteen Characters long. UNIX is case sensitive; therefore upper case and lower case alphabets are treated separately. There is no concept of primary and secondary name in UNIX. One cannot have embedded spaces in the file names. The File name can contain numbers, alphabets, dots and underscores. One cannot use reserved words and Commands of UNIX System as file names abc.c, demo, robot.abc, 123.a, my-file etc are valid filenames.