Unix and Shell Programming

As a practical course, this classroom instruction comprises one three hour session in the lab. Classroom instruction gives you an opportunity to answer questions about the reading and to demonstrate your knowledge.

Section A: Basic Unix

Introduction to Unix: files and directories

Section B: Commands

Operating on files, standard I/O redirection and pipes, Unix processes.

Section C: Scripts

Writing shell scripts, which combine Unix Commands

Section D: Awk

An introduction to the awk programming language


Unix gave rise to most other operating systems running today. It generated Linux, OSX, Android, iOS, and many others. It's progeny runs almost all super computers, and most web servers. It may be unfamiliar because most PCs run Windows and most people experience operating systems on PCs. However, learning to use Unix provides a critical skill to anyone who plans to work with computers.

When Unix was first developed, user interfaces were a command line interface (CLI). CLI users type commands into a terminal and the computer prints responses to these commands on the same terminal; there are no icons or mouses or clicks. This course first covers the commands and parameters that the CLI uses.

Unix also has a programming language for combining commands. This programming language, shell programming, lets you create new commands. The course covers shell programming after introducing the commands.

Finally, the course introduces "awk," a powerful command for text processing. It is used for data extraction and reporting.

Course Organization

This class is a practical, which means the classroom instruction is limited to one three hour session in the lab. It focuses on the practical aspects of programming computers.

The three hour lab class does not allow enough time for you to practices using Unix. Instead of completing a project in class, you will be expected to read material and work on the project outside of class. Usually, in the class, you will demonstrate the work you have started the previous week and ask questions about work you are to demonstrate the upcoming week. You will do most of your work on your own; the class provides guidance and an opportunity to ask questions.

This organization allows you to learn how to learn on your own. Learning on your own is the most important skill you can learn in college. No one knows what the technology of the future will be: Unix is almost 50 years old and yet it forms the core of Android, the worlds most popular operating system for accessing the Internet.

Access to Unix Computers

You will do your exercises on an AWS web server that your professor has set up. You will access these computer using a program called ssh. If you use either Linux or MacOS (which is also a version of unix) the ssh program is already available on you computer. If you use Windows, however, you will need to download and configure PuTTY.

You will be given an AWS account on which you can work. In addition, we recommend that you install Unix on your computer. Cygwin is the easiest way to do this. You may also install Ubuntu as a dual-boot operating system if you feel adventurous. If you install Unix on your computer you may access your AWS account using ssh as you will from the lab computers. You may also access your AWS account using the Putty terminal program.

Do not turn in programs others have written as your own. It is very obvious when you do. Also, if you give your program to other students it is hard to tell the true author of the work.

  • Install the Putty terminal and log in to AWS This is probably the simplest way to access Unix from home. I have set up a server on Amazon Web Services that is running Ubuntu. You can log on to this server and use it. The terminal will work the same way the terminal work in the lab, but you will not have access to the GUI elements. You will need to have me set up an account for you.
  • Install Cygwin Cygwin is the set of programs that make up user level access to Unix running as a Windows program. In particular, you can run the bash shell as a Windows program. It works the same way the terminal in the lab works, but you will not have access to the GUI features you have in the lab.

    I have also written step by step instructions on setting up Cygwin

  • Dual Boot Windows and Ubuntu This is probably the most difficult route, but the system you will run will be exactly the same one you have in the lab. You will have the same GUI, and you will start a terminal from the GUI.