Introduction to Unix

Overview & Intended Audience

This document is intended as a tutorial to assist you in learning how to use Unix. An implementation of Unix is used as the operating system on ARC’s systems. The information contained in this user guide should also be applicable to Linux, OS-X, and most other Unix systems so that this guide can also be used for learning Unix on other systems as well as the ARC systems.

A Unix shell provides you with an interface for interacting with the Unix kernel. The examples presented in this users guide assume use of the BASH (bash) shell which is the default shell used on the VT ARC accounts unless you had specifically requested a different shell on your account application. The Bourne (sh), Korn (ksh), and C (csh) shells are also available on the VT ARC systems. Where there are known differences between the BASH shell and these shells, alternative examples or notes are included to explain how commands or the examples should be modified to enable the function for the Bourne, Korn, or C shell.

The Shell Selection Summary describes similarities and differences among these shells. Since some shell features, such as alias and history, are not available in the Bourne shell, it is recommended that you use the BASH, Korn, or C shell as your login shell for interactive applications.

It is recommended that experienced Unix users review the contents of the following sections and note differences between the Unix systems you are familiar with and the information presented here:

If you have not used Unix before, but are already familiar with the IBM mainframe VM/CMS, DEC VAX/VMS, or PC-DOS operating system(s), you may find the table of Unix Command Comparisons a useful starting point for beginning to use a Unix system.

If you have never used a Unix system before, it is recommended that you become familiar with the information provided in each of the following sections and complete each of the examples as they are presented:

Programmers who are not familiar with Unix development tools may find the following sections especially useful:

In general, the information contained in this document should be applicable to most Unix systems;  exceptions may include:

  • Some commands (e.g., info and the joe editor) may not be found on other implementions of Unix or they may perform different functions.
  • Command options may differ from those found on your system. In general, most options used in the examples of this users guide should perform the indicated function on all Unix systems. Known differences are indicated within notes of the text.
  • Availability of application software.  The C programming language will be found on most Unix systems, but a Fortran compiler and other applications described here may not be installed on your system.  Utility libraries described in the users guide may not be available, may contain different routines, or may be located in directories other than those listed here.

This users guide is not a complete description of the ARC systems;  there are many commands and command options available which are not described herein.  See the online system documentation for a complete description of the system capabilities.

It is recommended that you read some of the many popular books on Unix;  VT ARC recommends A Practical Guide to the Unix System by Mark G. Sobel as a beginning text.  In addition to providing a very good introduction to the Unix operating system, it includes an appendix detailing the use of the most common Unix utility programs.

Notation

All Unix based systems have case sensitive commands. That is, it makes a difference whether you enter items in upper or lower case.  When we show Unix command syntax, we will indicate items that you must enter “as is” in the required case. When we show items for which you must supply a value, we will include the term “your_”, “my_”, or “their_”. For example, to compile a C language source program and specify the name for the resultant executable program, you might see:

cc  -o  my_executable  my_c_source.c

Key Representations

The “less than” (<) and “greater than” (>) symbols are used as pairs surrounding the names of keys or key sequences to distinguish them from Unix commands or symbols. For example, <Return> is used to refer to the key used to end a line and submit a command (or begin a new line). It may be represented on your keyboard by “Return”, “Ret”, “Enter”, “Newline”, or a bent arrow pointing left. Whenever you see <Return> in the text, press the key corresponding to this function.

Note: In C source code examples <stdio.h> and <time.h> are used in the standard fashion to indicate C programming language include files.

Note: The individual symbols “<” and “>” or the pair “>>” are used in the standard Unix sense to indicate the Unix redirection characters.

Control Key Sequences

Unix based systems such as Unix use control key sequences indicated by “Ctrl-C”, where C can be any letter from A to Z. You might see a sentence like this:

You can interrupt execution of the “xyz” command by pressing Ctrl-C.

To issue Ctrl-C, hold down the CTRL key while you press the lower case “c” key. All control key sequences are shown with an upper case letter. You may always use the lower case letter.

Note: Do not press the “-” key as part of the control key sequence; the dash is used within the notation to separate “Ctrl” from the specification of the key which is to follow.

Note: You do not have to press <Return> following control key sequences.

Commands in the Body

If the text is easy to follow and clear, the command will not be set off in any special way in the body. For example:

To display a list of your files, use the ls command.

If the text is complex, a command or filename may be enclosed in quotes, such as:

To display a list of your files and their access permissions, enter the command “ls -l“.

“1” vs “l”

Some display and print environments do not distinguish well between the number one (“1”) and the lower case letter L (“l”).

If your display does not distinguish between these characters, the following words should be interpreted as containing the number one (“1”):

  • us1
  • vt100

If your display does not distinguish between these characters, the following words should be interpreted as containing the letter lowercase L (“l”):

  • imsl library
  • l — move cursor right when using the vi editor
  • -l — an option to a Unix utility program
  • ls
  • learn
  • xlc, xlf, and xlp
  • link
  • lint
  • lp or lpr command
  • login and logout

Software Availability

You should find that most of the Unix commands with which you are familiar, or which are documented in standard Unix texts, are available on the VT ARC systems.

Text Editors

The following popular full screen editors are currently available on the VT ARC systems:

  • vi: A popular full screen text editor found on most Unix systems. See Using the “vi” Editor for a description of the most commonly used vi commands. For more information on using the vi editor, enter:  man vi
  • joe: A full screen text editor that uses “Ctrl” key sequences in its operation. To start using this editor, simply enter the command “joe” at the Unix prompt. Once you have started joe, you can display a Ctrl key function summary chart by pressing and holding down the Ctrl key, simultaneously pressing the “K” key, releasing both of these keys, and then pressing the “H” key. For more information on using the joe editor, enter:  man joe

The ed and ex editors are also available.

Software Applications

For information about software applications available at Virginia Tech and on the VT ARC systems, see Application Software For Research Computing at Virginia Tech.