LAB 01 - Intro to UNIX and Java
Welcome to the first CS 180 lab! The purpose of this first lab is to walk you through getting started with UNIX and Java. If you have
no prior experience with a UNIX-like environment, don’t worry. This lab will guide you through everything you need to know to
accomplish simple tasks using a UNIX command line environment and to create a simple Java program. So, let’s begin with a
discussion of what exactly UNIX is.
UNIX is a class of operating systems descending from a system created in 1969 at Bell Labs. There are a tremendous variety of
different UNIXes, and chances are that you are already familiar with a few. For instance, most current Apple products run on Mac
OS X, which is a variety of UNIX. There are also many UNIX-like operating systems, which don’t meet the exacting specifications
set up by the owners of the UNIX trademark, but are essentially UNIX. These include the Linux operating system and Google’s
Android platform. Most of the Lawson lab computers run a variety of Linux called Gentoo, while the “lore” server set up for
undergraduate CS use runs Solaris, which is a bona-fide UNIX. Accordingly, a very large amount of your time will be spent working
in a UNIX environment; thus, it is worthwhile to learn UNIX well.
If you are curious, more information on UNIX can be found
What is the command line?
The command line is a text-based system for communicating with a computer. Before the creation of the Graphical User Interface,
or GUI, the command line was effectively the only way to use computers. The user would use the keyboard (since this was before
the advent of mice) to enter commands to the computer, and receive results as text on the screen or on a printer.
Even now, when GUIs have become the norm, the command line remains available in the form of a graphical program called
, which simulates typing commands and receiving output from a text terminal. This terminal emulator connects
to a program called a
, which does the job of interpreting the user’s commands, executing them, and outputting the results.
Many different types of shells exist, but for this course, you will be using a shell called
, which is among the most popular.
How does the command line work?
Open your computer’s terminal emulator by right clicking on an empty portion of the desktop, then clicking “Open Terminal”. (You
can also access the terminal from the Accessories menu.)
You should see something akin to:
lore 51 /homes/
This is the called the
, which is printed by bash to request a command from the user. Here, “lore” is the name of the
computer you are currently logged into, “51” is the number of commands you’ve entered before this one, and “/homes/
” is the current directory.
Enter the command “ls,” by typing ls, then Enter.