File types.
The Unix system treats everything it has to deal with as either a process or a
file (or both). For better control, it recognizes several types of files.
All files known to the Unix system must be listed somewhere in the directory
tree. Items that can be viewed as a file are such things as user created text
files, compiled executable programs, directory listings, the terminal keyboard
interface, the terminal screen interface, each partition on any hard drives to
be accessed by the Unix system, and any printers to be used. Because running
processes have to communicate with the kernel (the primary process that is
Unix), even the kernel has a filename entry in the system's directory tree.
However, because a keyboard is obviously different from a text file, the Unix
system provides ways to correctly identify and handle different file types
appropriately.
The following types are recognized by all Unix systems :
Regular file - this is a collection of data bytes stored on the system's
secondary storage devices (usually a hard drive). These files may be readable
text or they may be binary executable program code.
Directory file - this is a data file that contains a list of file names and
a reference for tracking their storage on the system's secondary devices such
as a hard drive. Files marked as directories can be manipulated by commands such
as mkdir, rmdir, cd, mv, cp, etc. They are also off limits or other commands
that could damage them.
Symbolic file - this is a data file that contains path information to a
file stored elsewhere on the system. It is used to create shortcuts or
alternative names for an existing file. Because it is marked as symbolic,
several commands that would normally work on the file's contents, will instead
use its contents to seek out the file indicated.
FIFO file - also called a named pipe. This file is used when a process
needs a buffer file for holding generated output that needs to be sent to a
second running program is not yet ready for it or that is slower. When you use
|, the pipe ) symbol, you are using an un-named pipe, a variation of this
filetype.
Character Special - This is an interface to a device such as a keyboard
where data is transferred one byte at a time. Seldom used directly by user but
commonly owned and accessed by the Unix OS.
Block Special - This is an interface to a device such as a hard drive where
data is buffered and transferred in specific block sizes. Seldom directly by user
but commonly owned and accessed by the Unix OS. Like character special, this is
primarily a system level file.
Socket file - Another special file used for network communication.
Some versions of the Unix system may support a few additional file types.
Exploring other direcories
Overview