next up previous contents
Next: Unix-software examples: Up: Down to specifics: Linux Previous: Choices: Why RedHat,... Fedora


The Unix Environment

UNIX is an operating system consisting of three important features; a kernel, the shell and a file system.

As its name implies, the kernel is at the core of each UNIX system and is loaded in whenever the system is started up - referred to as a boot of the system. It manages the entire resources of the system, presenting them to you and every other user as a coherent system. You do not need to know anything about the kernel in order to use a UNIX system. Amongst the functions performed by the kernel are:

  • managing the machine's memory and allocating it to each process.
  • scheduling the work done by the CPU so that the work of each user is carried out as efficiently as is possible.
  • organizing the transfer of data from one part of the machine to another.
  • accepting instructions from the shell and carrying them out.
  • enforcing the access permissions that are in force on the file system.

Whenever you login to a Unix system you are placed in a program called the shell. You can see its prompt at the bottom left of your screen. To get your work done, you enter commands at this prompt. The shell acts as a command interpreter; it takes each command and passes it to the operating system kernel to be acted upon. It then displays the results of this operation on your screen. The shell provides you with one or more of the following features. You can:

  • create an environment that meets your needs
  • write shell scripts
  • define command aliases
  • manipulate the command history
  • automatically complete the command line
  • edit the command line

A file system is a logical method for organizing and storing large amounts of information in a way which makes it easy manage. The file system is the smallest unit in which information is stored. The UNIX file system has several important features:

  • Different types of files

    To you, the user, it appears as though there is only one type of file in UNIX - the file which is used to hold your information. In fact, the UNIX file system contains several types of files.

    • Ordinary File: This type of file is 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.

    • Directories: A directory is a file that holds other files and other directories. You can create directories in your home directory to hold files and other sub-directories.

      Having your own directory structure gives you a definable place to work from and allows you to structure your information in a way that makes best sense to you.

      Directories which you create belong to you - you are said to "own" them - and you can set access permissions to control which other users can have access to the information they contain.

    • Special files: This type of file is used to represent a real physical device such as a printer, tape drive or terminal.

      It may seem unusual to think of a physical device as a file, but it allows you to send the output of a command to a device in the same way that you send it to a file. For example:

      cat scream.au > /dev/audio

      This sends the contents of the sound file scream.au to the file /dev/audio which represents the audio device attached to the system. Guess what sound this makes?

      The directory /dev contains the special files which are used to represent devices on a UNIX system.

    • 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.

  • Structure of the File System

    • Your home directory: Any UNIX system can have many users on it at any one time. As a user you are given a home directory in which you are placed whenever you log on to the system.

      User's home directories are usually grouped together under a system directory such as /home. A large UNIX system may have several hundred users, with their home directories grouped in sub directories according to some schema such as their organizational department.

    • Your current directory: When you log on to the system you are always placed in your home directory. At first this is your current directory. If you then change to another directory this becomes your current directory. The command pwd displays the full path name to your current directory.

    • Pathnames: Every file and directory in the file system can be identified by a complete list of the names of the directories that are on the route from the root directory to that file or directory.

    • Access permissions: Every file and directory in your account can be protected from or made accessible to other users by changing its access permissions. You can only change the permissions for files and directories that you own.


next up previous contents
Next: Unix-software examples: Up: Down to specifics: Linux Previous: Choices: Why RedHat,... Fedora

© Copyright 2001-2006 CCRMA, Stanford University. All rights reserved.
Created and Mantained by Juan Reyes