Introduction to UNIX - Part 1: Basic Concepts

Up to the Index Continue to Part 2

What is UNIX?

By the most simple definition, UNIX is a computer operating system - the base software that controls a computer system and its peripherals. In this sense, UNIX behaves in the same way that the perhaps more familiar PC operating systems Windows or MacOS behave. It provides the base mechanisms for booting a computer, logging in, running applications, storing and retrieving files, etc.

More specificially, the word "UNIX" refers to a family of operating systems that are related to one or both of the original UNIX operating systems - BSD and SystemV. Examples of modern UNIX operating systems include IRIX (from SGI), Solaris (from Sun), Tru64 (from Compaq) and Linux (from the Free Software community). Even though these different "flavors" of UNIX have unique characteristics and come from different sources, they all work alike in a number of fundamental ways. If you gain familiarity with any one of these UNIX-based operating systems, you will also have gained at least some familiarity with nearly every other variant of UNIX.

UNIX fundamentals

UNIX has been around for a long time (over 30 years). It predates the concept of the personal computer. As such, it was designed from the ground up to be a multi-user, shared, networked operating environment. UNIX has concepts such as Users, Groups, Permissions and Network-Shared Resources (such as files, printers, other computer systems, etc.) built-in to the core of its design. This makes UNIX a uniquely powerful and flexible operating system. Along with this power and flexibility comes some unique concepts that make UNIX what it is. These concepts are relatively simple and should be understood to take full advantage of the operating system.

  • Users - In order to make use of a UNIX system, you must first log in. This requires a user account, which consists of:

    • Username:
      This is your login name and is how you are identified to the system itself and to other users of the system.
    • Password:
      Along with your username, your password grants you access to the system. Don't forget or lose your password. If you write your password down, keep it in a safe place.
    • Default group:
      The default group that your username belongs to (see Groups below).
    • Contact info:
      So that system administrators and other users can contact you if necessary.
    • Home directory:
      A directory or "folder" assigned to your username. This grants you access to disk storage. This is where you will keep your files and data.
    • Default shell:
      The program which manages your login and command line sessions (covered in detail later)

  • Groups - A UNIX group is a collection of users - i.e. a list of usernames. Groups provide a mechanism to assign permissions (see below) to a list of users all at once. For our purposes, group associations are typically based on which research group or area of study a user is affiliated with. Each user can belong to more than one group.

  • Permissions - Everything in UNIX is "owned" by both a user and a group. The simplest example of this would be files (but this concept is not limited only to files). By manipulating permissions, the user who owns a file can define which other users and groups can read or modify that file. In this way, users can secure sensitive files from prying eyes and keep themselves or others from accidentially deleting important data.

  • Shared Resources - UNIX is a networked operating environment at its core. As such, nearly everything that one can access on the local system can also be accessed via the network from remote systems. This includes, among other possibilities, editing and sharing files, running software, or using printers. Even the contents of a UNIX system's display can be manipulated remotely.

    The actions that an individual user is able to perform remotely is defined by the permissions assigned to that user (or any group to which the user belongs) for each of these activities. Some of these things will be discussed in greater detail later on.

UNIX Processes

When a program is started on UNIX, it creates what is known as a "process" on the system. Every process is assigned a unique serial number called its process id or PID for short. Processes can be created by any user, but can only be destroyed by someone with the permissions to do so - usually the user that created the process or the system administrator. This ensures that the compute jobs you start on the system will not be disturbed by any other user of the system until they complete or you decide to stop them yourself.

Processes and process management becomes important on UNIX systems that are shared between a number of users. The concept of users and PIDs is the main tool by which the available system resources are shared fairly among everybody who needs access to them. Processes can be suspended or given lower priority in cases where one or more users should step out of the way for someone else, but wish to do so without losing their work up to that point.

One further consideration on this topic is the fact that a running UNIX process can spawn "child" processes. For example, any program you run from inside a UNIX shell will be a child process of that shell. Conversely, the shell is the parent process of this child. Child proceses have associated with them both their own process id (PID) as well as their parent's process id (PPID).

Normally this concept of parent and child processes is not something you need to be bothered with as a user. However, it can be useful to understand how UNIX organizes processes if you are trying to keep track of certain system resources (e.g. memory and CPU), if you are working with environment variables, or if you need to track down a rogue program or script. Some of these items will be discussed later so it's good to have a basic idea about what a UNIX process is.

Up to the Index Continue to Part 2