Introduction to Using Computers at UTSA
This web page is intended for students in CS 1713, section 3, Introduction
to Computer Science, as an introduction to using the systems that a
Computer Science major is most likely to encounter during his or her
The World Wide Web
If you are reading this document, then you are already somewhat aquainted
with a World Wide Web browser. There are two
types of Web browsers: graphical and text-based. There are many graphical
browsers you may encounter; the most popular are Netscape, Mosaic, and
I will refer to them all generically as Netscape, since that seems to be the
one everybody uses. The text-based Web browser used on Unix systems is
called lynx. Press the space bar in lynx, or use the down arrow
key in Netscape, to see more of this page. You can go back up using
the up-arrow in either Netscape or lynx.
The Web is a way to access information from computers
all around the world using a browser like the one you're using. Certain
underlined words or phrases, or pictures in the text can be selected by
on them using a graphical browser, or moving around with the up and down
arrow keys and pressing RETURN or ENTER when the word you want is
highlighted. Try that with this phrase.
Some of the text you select may show you files located
on computers in other parts of the country or even other countries.
If you get lost, don't panic; you can always quit using the 'q'
key in lynx or choose File/Exit from the graphical browsers and
then restart your session. For detailed help on using Web browsers,
choose Help. In lynx, you just type 'h' for help. In Netscape, click on
the word "Help" in the far upper right corner of the Netscape window.
As you become more comfortable with the Web, you'll learn ways of moving
around, searching for interesting information, etc.
The MS Computer Lab
The MS Computer Lab, located in the first floor of the MS building
(the part of the building on the ground floor closest to the new University
Center) has two different kinds of computing equipment that you may use.
It has personal computers and VT320 terminals. The personal computers (PCs)
may be used for Web browsing using Netscape. They are mainly intended for
people in the Microcomputer Applications class and other classes that require
PC-type applications such as word processing, spreadsheets, etc. Computer
science majors typically don't use those programs for classwork. The VT320
terminals allow you to connect to (among other things) the computer system
known as runner. runner is a Sun computer capable of supporting
many users at the same time. It runs the Unix operating system and is
the platform for which introductory computer science students should
write their programs.
The Runner System
When you take your first CS class, such as CS 1073, CS 2073, or CS 1713,
an account will be created for you on runner. To begin using
runner (a process called logging in ), do the following:
At this point, you are logged into runner, and you are "in" a program
called a shell. Depending on when you got your account, you may be either
in the Korn shell or the C shell. For our purposes, they are not much
different, but it will become in the future important to know which one you're using.
The shell allows you to interact with the computer by typing in commands
and configuring your account so it fits your needs. Here is a list of
commands you can type in at the % or $ prompt on runner.
To use them, type the name of the command along with any additional
parameters , i.e., other information the command may need,
and then press RETURN or ENTER. Note: Unix is a case-sensitive
environment. That means that if you type something in uppercase that
is supposed to be in lowercase, you will probably not get the behavior
that you expect. You may select each of the following commands to go to
the section of the page that deals with it:
- Find a free VT320 terminal in the lab. This is actually an art form
in itself; yelling "There's free beer in the UC" might work a few times,
but it is just a fact of life that there are often fewer free terminals than
students needing terminals.
- Make sure the terminal is working. Some of the terminals in the lab
may have been left by the previous user in a weird non-working state. Consult
the helpful workers in the lab if this is the case with the only terminal
you can find.
- Press RETURN a few times. You should eventually see a screen that looks
something like this
The Univerity of Texas at San Antonio
with a cursor to the right of Local>. From there, type
c runner and then press RETURN to connect to the runner
system. You will then see something like this:
Connected to runner.jpl.utsa.edu.
UNIX(r) System V Release 4.0 (runner)
with a cursor the the right of login:. Type in the login name
your teacher has given you and press RETURN. You will then be prompted
for a password. Initially, your password will be your student ID number
(i.e., your social security number) without dashes, e.g., 123456789.
When you type in your password, you will not see it on the screen; this
is so that no one can look over your shoulder and get it. The computer
should immediately help you change your password (if not, see below for how
to do it yourself). It will ask you to enter your old password, then enter
a new password twice. The new password should be something not related to
your login name and should have digits as well as alphabetic characters
in it, so that it will be hard for someone else to guess and thus have
unauthorized access to your account.
- man , lets you read the manual pages for Unix.
- lynx , a text-based Web browser.
- echo , a simple command that displays text on the screen
- trn , a Usenet news reader.
- Mail , an e-mail program.
- elm , an easier to use e-mail program.
- pine , another easy to use e-mail program.
- ls , a command to list your files.
- vi , an editor you can use to write programs
- cc , a compiler to translate your programs to
- passwd , a command to change your password.
- man. This command allows you to read the manual pages for the
version of Unix that runner uses, called Solaris 2.3. Simply
type man followed by the name of the command you would like to
know about, and the computer will display the part manual for that command.
If you don't know the name of the command or are just curious about some
topic pertaining to runner, type man -k followed
by one or more topics you're interested in. For example, if I want to
know the command for compiling a program, I type man -k compiler
and the computer prints a list like this:
cc cc (1b) - C compiler
rpcgen rpcgen (1) - an RPC protocol compiler
tic tic (1m) - terminfo compiler
yacc yacc (1) - yet another compiler-compiler
zic zic (1m) - time zone compiler
Hmm, I don't know what all those other things are, but cc looks
like what I'm interested in, so I want to see the man page for cc.
I'll type man cc and get the manual page for the C compiler.
Notice the -k I put after man. This is an
option or switch to the command. Most Unix commands
have options; they are described in detail in the man page for each
- lynx. This is the text-based Web browser described above.
To use it, you can either just type lynx at the command
prompt, or provide it with a URL (Uniform Resource Locator) for the
file you want to start browsing, e.g. lynx http://www.utsa.edu/
for the UTSA Web page.
- echo. This simple command lets you display text on the
screen. If you type echo hello and then hit RETURN, the computer
will respond by printing hello on the screen. Certain special
words beginning with the dollar sign are interpreted differenly by the
shell. For instance, if you type echo $SHELL, the computer will
show you which shell you are using. When I do this, it displays
/bin/csh, indicating that I am using the C shell.
- trn. This is a newsreader. It allows you to read Usenet
news, a system divided into tens of thousands of "newsgroups" contributed to
by people all over the world. You can contribute to newsgroups, too, and people
all around the world can read your messages. Note: newsgroups mentioned
in this Web page may appear highlighted; this is because you can also read
them from your Web browser by simply selecting them. However, trn
is preferred by some people because it is a little more friendly environment
and can be run where some Web browsers can't. The first time you enter
brief section of explanatory text will appear on the screen, a special
file called .newsrc will be created for you (nothing you need
to think about just yet), and then you
will be "in" trn. You will not see this text again unless a new version of
trn is installed on runner. Once you are in trn
, you will probably be presented with something like the following:
Unread news in general 30 articles
Unread news in comp.arch 22 articles
Unread news in sci.math 290 articles
Unread news in utsa.cs.1713-2 13 articles
Unread news in utsa.cs.1713-3 25 articles
After this, you may see something like:
Checking for new newsgroups...
Newsgroup comp.new.group not in .newsrc -- subscribe? [ynYN]
This means that one or more new newsgroups have become available since the
last time you logged in. If you just type uppercase Y, all the new newsgroups
will be added to your .newsrc, i.e., your list of subscribed
newsgroups. If you don't want to see them, type uppercase N and they
will be marked as unsubscribed. If you want to choose each new newsgroup
individually, use lowercase instead of uppercase y or n.
After all the nonsense is over with, you can begin reading news. First, select
a newsgroup. This will be your current newsgroup . You can choose
the first newsgroup in the system simply by hitting the space bar, or go to
a particular newsgroup by typing g followed by the name of the
group. If you're not sure of the exact name, you can search for it using
the / key followed by something in the name of the group.
So, you will see something like this:
====== 3 unread articles in news.announce.newusers -- read now? [+ynq] _
with a cursor at the end of the line. If you wanted to go to the newsgroup
you could type g utsa.cs.1713-3.d from there,
or simply /1713 and then hit n (for next) to get
to the right newsgroup.
Once you have selected a newsgroup, you can begin reading articles by
hitting the space bar. You will be presented with the first screenful
of text from the article; if you want to see more of that article,
hit the spacebar again. If you don't, type j (for junk),
then the space bar, and you can go to the next article. Type h
at any point for more details on how to use trn. To get out
of trn and back into the shell, type q. You may
need to type it two or three times depending on what state the newsreader
is in. I suggest you try out trn for a while before reading
the rest of this section.
Let's say you have read someone's article and want to respond to it.
While reading the article, type r (or R if you
want to quote their article in your message) and you will be asked a few
questions, then put into an editor so you can compose an e-mail message.
If you would like your message to be posted to the newsgroup instead of
e-mailed, use f or F instead of r.
Please don't post an article to a Usenet newsgroup (except for
our class newsgroup) until you have become familiar with the writing style
and etiquette involved. Hang out on
news.announce.newusers for a while to get an idea of what you're
dealing with. Remember, if you post to a worldwide newsgroup, you are
representing yourself as well as UTSA to people all around the world
with different cultures and ideas.
- Mail. This is an e-mail program. You can use it to
send electronic mail messages to other people. Some instructors will require
you to turn in assignments through e-mail, too. Note that the first
M in Mail is capitalized; make sure you type it this way
when you use it on runner.
To send someone an e-mail message, you need to know their e-mail address.
This will look something like email@example.com
(this is not a real e-mail address, don't send anything to it).
Type Mail -s "subject" address where
subject is the subject of the e-mail, i.e., a few words describing
what the e-mail is about, and address is the e-mail address.
After you press RETURN, the cursor will go to the next line and you may
begin typing your message. If you want to edit your message with an
editor like vi, type ~v at the
beginning of a new line. If you decide you don't want to send this message,
press CTRL-C twice. When you are done with the message, type a single
period (.) at the beginning of a new line, and your message
will be sent and you will be back in the shell.
To read your e-mail, simply type Mail in the shell. If you don't
have any e-mail waiting for you, the program will let you know. Otherwise,
you will enter an interactive shell-like environment where you can read
e-mail message and respond to them. For instance, if I type Mail
from my Unix prompt, I will see the following:
mailx version 5.0 Wed Oct 25 04:12:43 PDT 1995 Type ? for help.
"/var/mail/djimenez": 1 messages 1 new 2 unread
>N 1 Daniel Jimenez Fri Feb 30 17:31 15/366 stuff
This indicates that I have a single e-mail message from Daniel Jimenez
(yes, I sent myself an e-mail message) with subject "stuff."
From here I can type RETURN to see the message, or type q to
quit and save the message in a file of already-read e-mail message, or
just type x to quit and leave my mailbox in the same state
it was before I entered Mail.
- elm. This is a full-screen e-mail program, i.e., it
lets you navigate through your e-mail and send other people message by
choosing items from a menu. It is somewhat like lynx, except it's just
for e-mail. Read the man page for elm for more details
(real programmers use Mail).
- pine. This is another full-screen e-mail program like
elm . Many people at UTSA like it for its ability to send
attachments and graphics (although it is a text-based program). Again,
real programmers use Mail, pine is for sissies :-)
(that :-) is a "smiley" and means a happy face, a joke, ha ha, not
being serious, and so forth).
- ls. This command allows you to see information about the
files in a directory . A directory is a place where you can hold
some of your files. You have a main directory that you are
"in" when you first log in, and you can make other directories to store
related files if you like. ls will show you the names of
the files in your directory. If you type ls -l, you will see
the names in a long format showing the size, creation date, and other
information about the files. See the man page for ls for a
description of all the options to ls.
- vi. This is a popular editor that works on all
Unix systems. An editor allows you to enter, edit, and save text files, such
as computer program source code. It is somewhat similar to a stripped-down
word processor. There are other editors available under Unix, but vi
is the most widely available.
To edit a file, enter vi followed by the name of the file. If the
file doesn't yet exist, you will be presented with a "blank" screen with
tildes (~) running down the left side of the screen. Otherwise, you will
see the contents of the file, possibly followed by tildes marking the end
of the file. vi allows the user to type commands using a few
keystrokes. It can be faster than using a word processor, but can be challenging
to learn at first. Refer to a Unix book for more information about
vi commands; a few basic commands are presented here. vi
has two modes , command mode and insert mode. In command mode, anything
you type is interpreted by vi as a command to the editor to do
something. For instance, in command mode, typing the sequence :wq
tells the editor to Write (i.e., save) the current file, then Quit back
into the shell (or whatever other program invoked vi). In insert
mode, anything you type is echoed to the screen and becomes part of the file
you are editing, just like in a word processor. Press ESC (or CTRL-[ on
terminals without an ESC key) to return to command mode from insert mode.
If you're not sure what mode you're in, press ESC a couple of times until
you hear a beep; then you know your in command mode. Most commands can
be aborted in the middle by pressing ESC. Many of the following commands
are described in terms of the current position; this is, depending
on the context, the character or line occupied by the cursor.
Here are a few common commands;
remember, they are case-sensitive and must be entered from command mode:
This is just a small sample of vi commands, but it is enough to
start you editing your own text files.
- i Enter insert mode, inserting text before the
character at the cursor position.
- a Enter insert mode, inserting text after the
character at the cursor position.
- I Enter insert mode, inserting text at the beginning of
the current line.
- A Enter insert mode, inserting text at the end of
the current line, i.e., appending text to the current line.
- j Go down one line.
- k Go up one line.
- l Go one space to the right.
- h Go one space to the left.
- o Open a new line after the current line, i.e., insert
an empty line between the current and next line, remaining in insert mode.
- x Delete the current character (like the DEL key in a
- X Delete the character to the left of the current character
(like the BACKSPACE key in a word processor).
- dd Delete the current line.
- dnd Delete n lines from the current cursor
position, for example, d10d to delete ten lines. Note: some
versions of vi won't display the characters of the commands
as you are typing them, so make sure you type d10d instead of,
- u Undo the last command. This is useful if you just deleted
something you didn't mean to delete, or inserted something you didn't mean
- p Paste the last section of deleted text after the current
line. You can do "cut and paste" in vi by going to the section
you want to cut, deleting it, going where you want to paste, and using the
p command. You can type p as many times as you want,
inserting another copy of the last text deleted each time.
- :w Save the current file and continue editing. Note: many
vi commands begin with a colon (:). You will see these commands
displayed at the bottom of the screen because many of them take parameters
you need to be able to see to type.
- :wfilename Save the current file to a different
- :q Quit the editor. If you have made modifications to
the text, vi won't let you quit like this.
- :q! Really quit the editor, abandoning all changes you have
made during this session.
- :rfilename Read the contents of the named file into
the editor at the current position.
- :sh Start a Unix shell. Typing exit from the
shell will return you to the vi session from which it was started.
- :!command Execute the specified Unix command, returning
to vi when it is done.
- cc . This is the command to invoke the C compiler. You
give it command-line parameters that specify one or more source files
and it produces an executable program (or linkable object file, depending
on on parameters). For instance, the command cc foo.c compiles
the program in the text file foo.c (created with vi or
some other editor) and produces an executable file called a.out.
You can then execute a.out if the compilation succeeded, or read
the error messages if it failed. Normally, you will want to name your
executable something other than a.out, so use the -o
option to cc, e.g., cc -o foo foo.c will compile foo.c
and call the resulting executable foo. Note: If you get
the order wrong on a command like the previous one, say, cc -o foo.c foo,
cc will probably overwrite your source file, thinking that that's
what you want to name your binary. Be careful you don't do this. See the
man page for cc for more information on the options.
- passwd . This command allows you to change your password.
On many Unix systems, including runner, a password must be reasonably
secure in the sense that it is hard to guess. You must have at least six
characters in your password, and some of them must be digits or special
characters. Two short unrelated words separated by a special character or
digit is usually both secure and easy to remember. Examples of good
passwords: djgh12xz, cat.mart.
Examples of bad passwords: your login name backwards (or forwards!), your
birthdate, your girlfriend's/boyfriend's/wife's/husband's/kids' etc. names,
any single word in any language (including German, Spanish, Hebrew,
French, Mandarin, Swahili, Telugu, you name it, people out there will try to
guess it). To use passwd, just enter the command. You will be
prompted for your old password (to make sure it is really you), then twice
for a new password. The second time is to verify you typed the same thing