Unix - UNIX File Management

UNIX File Management

On all UNIX systems user data is organised and stored in files.

These files are subsequently organised into a management structure comprising directories and sub-directories.

These directories and sub-dircetories are organised into a tree-like structure called the filesystem.

The following sections show how the users can create and remove files, copy and rename them, etc.

In UNIX there are three basic types of files:

  • Ordinary Files: An ordinary file actually holds the user's data or a set of program instructions.
  • Directories: Directories store the users files in a "folder" type of structure.
  • Special Files: Special files control access to certain types of hardware such as CD-ROM drives, Ethernet adapters. etc.

File Types

A file is a collection of related information that is resident in the file store and is identified by a unique filename. The UNIX operating system understands three different types of files:

ASCII Files:
This is the most common type of file found on most systems. It is a sequence of characters, or bytes. Examples of this type of file would be: source code files and executable, or binary, files. To the UNIX operating system there is no difference between a text file and a binary file: both are a stream of bytes divided up into "blocks" and stored on the filing system.

Directory Files:

A directory is a special type of file: it is a file of files. This type of file does not contain any text or executable programs but a list of filenames, and directory names, and other related information such as, location on the storage device, size of the files and their ownership.

Device Files:

UNIX provides a standard interface between the hardware, such as disks and printers, and the operating system. Device, or special, files are located in the sub-directory /dev. All input and output on a UNIX system is handled through the use of these files. The computer terminal, as far as the UNIX operating system is concerned, is a file.

To return the pathname associated with a user's terminal:

 

Type: tty
Response: /dev/tty00

(tty stands for teletype, a slow printer/terminal manufactured by the Teletype Corporation)

 

Source: http://www.le.ac.uk/oerresources/bdra/unix/page_35.htm