Using the Unix shell



Last revision August 6, 2004

Table of Contents:
  1. Shell interpretation
  2. Editing command lines
  3. Stuck in a Unix login session?
  4. Program execution
  5. Simple commands
  6. Unix command syntax
  7. Controlling processes
  8. Your login environment
Related topics:

What is actually happening when you log in to a Unix system?

These notes describe the process of using a command-line shell interface to Unix. If you are using an X Window terminal or the console of a Unix workstation, you must first establish your X Window session and then open a shell or command window (one is often opened automatically). These notes will apply to what happens within that shell window.

The preferred method of logging into a command-line shell over the network is to use an encrypted protocol such as kerberos or ssh. See the section on Unix accounts and passwords for a description of these protocols and the programs you can get to use them on your computer.

Unix treats each login window, whether via kerberos, ssh, X Window, plain telnet, rlogin, or other protocol, as a separate terminal, and these pages will use that word to refer to the window on your computer in which you interact with the remote Unix system. After the login connection is made, and account name and password are provided as needed, you will be running a single process on the Unix system that is attached to your terminal for input and output. This process is owned by your account and the program it runs is called the shell.

The shell interprets what you type to determine what you want to do. It then makes calls to the kernel (Unix) or starts up other processes running other programs as needed to carry out your commands.

There is more than one shell program. The one you use is set in the system accounts (password) file. All examples in these notes use the C-shell (program named csh), which is most commonly used on Berkeley Unix systems, and is the default shell for pangea accounts in the School of Earth Sciences. Many people now prefer tcsh, which is a newer superset of csh with additional features such as automatic filename completion. All features of csh described here should also work in tcsh.

  First Section-->

Comments or Questions?