< Introduction: The UNIX Operating System - Fulton Supercomputing Lab - BYU

Introduction: The UNIX Operating System

This tutorial teaches some basics about UNIX. Like Microsoft Windows and Apple Mac OS, UNIX is an operating system. By operating system, we mean the suite of programs which make the computer work. The supercomputer runs a variant of UNIX called Linux. Because jobs must be submitted to the supercomputer using UNIX commands, it is pertinent that you, as a user of the supercomputer, obtain at least a basic knowledge of the UNIX environment.

The UNIX operating system

In general, the UNIX operating system is made up of three parts; the kernel, the shell, and the programs.

The kernel

If we think of the UNIX operating system in terms of layers, the kernel is the lowest layer. It interfaces directly with the computer hardware and is responsible for allocating and managing the resouces available to programs. It allocates processor time and memory to each program and determines when each program will run. The kernel also provides an interface to programs whereby they may access files, the network, and devices.

The shell

The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and executes them. The commands are themselves programs. Once programs terminate, control is returned to the shell and the user receives another prompt ($ on our systems), indicating that another command may be entered.

The default shell for users on the supercomputer is the bash shell, but each user has the ability to customize his/her shell. Please see the FAQ question "How do I change my password and/or login shell?" from the marylou4 FAQ on the left for more information on how this is done. Most shells, including bash, provide features that make inputing commands easier for the user. Here are just a few of those features:

  • Tab Completion - By typing part of the name of a command, filename or directory and pressing the [Tab] key, the shell will complete the rest of the name automatically. If the shell finds more than one name beginning with those letters you have typed, it will show you all of the possibilites beginning with that combination.
  • History - The shell keeps a list of the commands you have typed in. If you need to repeat a command, you can use the up and down arrow keys to scroll up and down the list or enter history for a list of previous commands.

The programs

One of the main features of UNIX is that it includes a variety of small programs to meet various needs. Typically, each of these programs does one thing and does it well. This modular design allows the functionality of small programs to be mixed and matched. As you become more familiar with UNIX, you will find that this design provides you great flexibility and power to accomplish almost any task. Typically these programs operate on top of the shell, but they may also interface directly with the kernel.

Files and Processes

Everything in UNIX is either a file or a process.

  • A process is an executing program identified by a unique PID (process identifier).
  • A file is a collection of data.
    Some examples include:
    • a document (report, essay, etc.)
    • the text of a program written in some high-level programming language
    • instructions comprehensible directly to the machine and incomprehensible to a casual user, for example, a collection of binary digits (an executable or binary file)
    • a directory, containing information about its contents, which may be a mixture of other directories (subdirectories) and ordinary files

The Directory Structure

All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally called root (written as a "/").
Here is an overview of the directory structure on the supercomputer:

marylou4 directory structure