Return to: U of M Home

Gold University of Minnesota M. Skip to main content.University of Minnesota. Home page.
 
Academics.

Mechanical Engineering Home >Info: Useful Links > ITlabs Unix tutorial

1. Logging In and Logging Out

The UNIX workstations used for this class can be accessed either directly in room ME 308 or by remotely logging in from another workstation or personal computer. This tutorial assumes that you will begin by logging in directly at a workstation in ME 308. Once you are comfortable doing that, you may want to try logging in remotely, particularly if you have your own personal computer and a modem.

The procedure for obtaining an account for using the ME 308 workstations is described below. Procedures for logging on and obtaining a "window" for executing UNIX commands on your workstation screen are then described. Finally, the non-standard procedure for logging off of the Silicon Graphics workstations is explained.

You must have a login name in order to use the UNIX workstations. A name is obtained by paying the $165 per semester computer fee (that is automatically billed for upper division IT students). The name is obtained through your student e-mail account, although it is actually a separate account. Instruction sheets on obtaining your account name through e-mail are available in the ME 308 lab.

Sit down at any UNIX (i.e., "Indy" or Sun) workstations. All computers remain on at all times. If the screen was initially dark, it should light up upon typing the first letter of your user name. The letter will appear in a box on the screen labeled with the network name of the workstation that you are using. Type the remaining characters of your user name, then hit the "Enter" key. The cursor will then move to a "Password" line. Type the password for your account and hit the "Enter" key.

If your user name and password were accepted, the window that showed the network name will be replaced with a new display. If you are using your account number for the first time, a special procedure will automatically be initiated to "register" your account. Registration consists of following the simple directions that will appear on your screen. You need register your account at the start of every semester. If you choose to register on a PC, a web browser will open. Click "Initialize IT Account" and follow the directions.

If your user name and password were not accepted, the initial display showing the workstation's network name will re-appear. If this happens, be sure that the "Caps Lock" key is not locked. UNIX systems differentiate between upper case and lower case characters! If your user name and password are repeatedly rejected, see the lab attendant for assistance.

UNIX workstations provide a series of "windows" on your workstation screen. After logging on, the workstation screen may automatically open a UNIX window for you. If this is the case, you can skip the next step.

If the UNIX window is not opened automatically, you will see two or more small windows in the upper left corner of the screen. You can designate the window of your choice by moving the "mouse cursor", a small red arrow, around the screen with the "mouse" attached to the workstation. Slide the mouse along the elastic pad provided in the carrel of your workstation to move the mouse cursor.

One of the upper left windows will contain entries similar to: "Desktop / Selected / Find / System / Help". Move the cursor over the entry labeled "Desktop". Then, press and release the LEFT button on the top of the mouse. As you do this, a second "menu" will cascade off to the right of the "Desktop" entry. This will contain the entries, "Desks Overview / ... / Unix Shell / Enter". Move the cursor over the "Unix Shell" entry, then press and release the left mouse button. If on a Sun workstation, click the "x-term" button on the right side of the screen with the left mouse button.

After a pause of a few seconds, a new large window will appear. The window can be "dragged" to any convenient position using the mouse: move the mouse cursor over the title bar at the top of the window, press and hold down the left mouse button, drag the window to the desired position, then release the left mouse button.

The new window will appear similar to the screen of a non-windows based computer. The display will contain informative messages similar to the following:

(Several Lines of Information)
Erase is delete
Kill is control-U
TERM = (vt100)

The messages will not be underlined on your screen. Underlining is used in this tutorial to differentiate the entries that the system generates from the entries that you should type.

The symbol, "z", represents a cursor which indicates the position where text will be entered in the current window. Information can only be entered in the window containing the separate mouse cursor (the red arrow). If the text cursor is hollow rather than solid, or if your typing is not echoed in the window you expected, be sure that the mouse cursor is positioned somewhere in the window that you want to use.

Simply press the "Enter" key to set the "terminal type" to the default of "vt100". The workstation will then respond with the "system prompt" of a percent sign:
:
% z:
:

This prompt indicates that the system is waiting for you to enter a "systems-level" command.

Log out of a Sun computer by click the "logout" button on the right side menu bar.

Logging out requires a special procedure on the Silicon Graphics workstations. First, position the mouse cursor anywhere on the background portion of the screen (outside of any window). Then, press and hold down the right mouse button. This will cause a menu to appear, including the entries "Desktop / Logout / Enter". Continue to hold the right mouse button down and slide the mouse cursor over the "Logout" entry. Release the button after placing the cursor over the "Logout" entry.

Another window will then appear on the screen with the message, "Do you want to log out now?" The new window will contain two "radio buttons" labeled "Yes" and "No" below the log out message. Logging out is completed by positioning the mouse cursor anywhere over the "Yes" radio button, then pressing and releasing the left mouse button.

** IMPORTANT **.

Once you log on, you remain logged on indefinitely. Furthermore, if you type "logout" in your current window, the window will be closed, but you will NOT be logged off of the workstation! Logging on OPENS YOUR FILES TO ANYONE WHO TAKES THE WORKSTATION AFTER YOU. Therefore, be certain to always follow the log out procedure explained above before leaving your workstation!

You can be sure that you have logged out correctly when the original "User Name" screen re-appears.

2. Some Useful Keys and Functions

Some key functions and system commands are described here that you may find helpful when working through the later sections of this tutorial.

  1. Backing Up to Correct Typing Errors
  1. Simply use the "delete" key included between the main keyboard area and the right keypad. The usual "backspace" key will cause extraneous characters to be printed on the SGI workstations, but not on the Sun computers. (More elegant ways for correcting errors within files will be described in Part 6.)

  2. "Emergency Stopping" a Command or Program

    Typing "^U" (i.e., holding down the "Control" key and simultaneously pressing key "U") will force most programs and utilities to terminate on the SGIs. Similarly, typing "^Z" on the Sun computers will terminated most programs. This is especially helpful for stopping programs in infinite loops.

  3. Displaying the Catalog of Files on Your Account

    All programs you will write must be created as files. All files you save are recorded in a catalog associated with your username. To list all files in the catalog, type the "ls" ("list") command, followed by a carriage return:

    % ls(CR)

    where (CR) symbolizes pressing the "Enter" key. (All UNIX system commands will typically be followed by pushing the "Enter" key. Therefore, the (CR)'s will not be explicitly shown in this tutorial from here on, unless its implied usage is not clear.) If you have not yet written any files, your directory will contain only some default files set up with your account.

  4. Obtaining On-Line Help

    The "man" ("manual") command is used for obtaining on-line help for UNIX operating system commands. Operating system commands are identifiable in the Tutorial by being preceded by the prompt sign, "%".

    The "man" command can readily be used to obtain information about system commands whose names are known to you. For example, to obtain help about the command, "f77", type:

    % man f77

    The manual page printout can be stopped at any time by pressing the "q" key.

    If you want to search for a command and can think of a keyword, "keyword", likely to be related to it, try issuing the command:

    % man -k keyword

    Extensive system documentation is available on-line. Readers wishing to learn more can obtain on-line help about the "man" command itself by issuing the command:

    % man man

  5. Listing a File on Your Terminal

    The contents of any file can be printed to the screen of your terminal by issuing the "cat" ("catalog") command. For example, if you had a file named "subhead.f" in your catalog, you could print this file by issuing the command:

    % cat subhead.f

  6. Obtaining Hardcopy

    A file named "filename" can be printed in room ME 308 by using the standard "lpr" ("lineprinter") command as follows:

    % lpr -Pme308 filename

    Your output will then be available in the laser printer named "me308" in ME 308. (Several minutes may elapse between the time you issue the "lpr" command and the time your output appears at the laser printer). See the consultant to pick up printouts.

    Please note that you will be charged for every page printed in the lab. Print cards good for 10 pages are purchasable for $1.00, while cards good for 50 pages are purchasable for $4.00. They can be purchased from the ME 308 lab attendant by check.

    If you want to send a color graphics print to the Tektronix Phaser 200 printers in ME 308, substitute "me308-color" or for "me308". The cost of Phaser 200 prints are double that of black and white.

  7. Deleting Unwanted Files

    Files can be deleted from your catalog with the "rm" ("remove file") command. Use this command with care, since once a file is deleted, it can not be recovered. Nevertheless, please regularly delete the unwanted files from your account, as storing these files wastes disk space and ultimately costs the University money. If you want to delete a file called "trash", simply issue the command:

    % rm trash:

  8. Backing Up Important Files

    If you have a file that is particularly important to you, such as a class project the day before the project is due, we STRONGLY suggest that you create a BACK UP copy of the file in case you accidentally damage or erase your working copy. This is easily accomplished using the "cp" ("copy file") command. For example, if you wish to create a file named "backup.f" to back up your file, "main.f", you would issue the command:

    % cp main.f backup.f:

  9. Controlling "Scrolling" of the Screen

    If you print text to a window of your workstation whose length exceeds the window's height, the text automatically "scrolls" until all the text sent to the window is printed. If you wish to inspect output near the beginning of the text, it may scroll out of the window before you have a chance to read it. This may occur while running a program or inspecting a file with the "cat" command (see item "e", above).

    You can print the contents of a long file one window height at a time by "piping the file to the 'more' utility". (This is easier done than said.) For example, to print the file, "longfile", screen by screen, issue the command:

    % more longfile

    Pressing the space bar will advance the file by one window height. The listing can be terminated at any time by pressing the key, "q". Also note that the window containing the listing of your file has a "scroll bar" near the left border. You can scroll backwards for many lines by manipulating the scroll bar with the mouse cursor. Move the scroll bar all the way to the bottom to return to entering new commands.

3. Directories

Directories are a useful method of organizing files you create. For example, if you were taking two courses which involved doing assignments on a workstation, it would be sensible to create a separate directory for each one. Like organizing a notebook or a file cabinet, use of directories allows you to partition a group of files away from others. You can create directories either in your home directory (the directory you find yourself in when you open a unix shell), or within any other directory which you have previously made.

Directory Issues and Commands
  • Definition of Terms:
  • To Facilitate the discussion of commands which follows we will establish definitions of a few terms.

    • Current directory: the directory in which you are currently working.
    • Parent directory: the directory which contains your current directory.
    • Subdirectory: a directory inside a directory.
    • Home directory: the directory which contains all of your created directories and files.
  • Directory Commands:
    • % mkdir (New Directory Name) Make a new directory:
    • % cd (Directory Name) Change location into another directory:
      Note: You can only change into a subdirectory using the cd command.
    • % cd (..) change directories to the parent directory of your current directory.
    • % pwd returns the location of your current directory. This statement stands for present working directory.
    • % rmdir (directory name) Deletes a directory. This command will only be accepted if the directory you wish to delete is empty of files.
    • % cp (file name) (directory name) Places a copy of the named file into the named directory.
    • % mv(file name) (directory name) Moves the named file into the named directory.
4. Issues Surrounding Your Unix Account
  • Mail
  • Having an itlabs account gives you another e-mail address. If you are not planning to maintain an itlabs account every quarter, you should keep your "@umn" account address as your e-mail address. However, even if you do not choose to use your itlabs account for mail, people may send you mail there that you will want to read. Here are some options and methods of accessing this mail.

    1. Mail Handling
    1. There are a number of mail handling applications available on the itlabs machines. The mail handling program used in the "@umn" facilities is called "pine". To access this application on the itlabs machines simply enter the following:

      % pine

      This will open up the same e-mail program which you have used before. You can use Pine while logged in directly at one of the workstations or via telnet from a pc or mac on campus or at your home.

      If you are logged on directly at a workstation you may use another application which allows you to use a mouse, and has a point and click type interface similar to popmail or a word processor. This application is called "media mail", and can be accessed by typing at the prompt:

      % zmail

      This will open a separate window on the SGIs, but not Suns, in which this application will run.

    2. Mail Forwarding

      If you choose, you may forward mail sent to your itlabs account on to your "@umn" account. To forward mail, create a file called ".forward" in your main directory. In that file, place the full address of your "@umn" account.

      If you elect this option, be sure you understand what happens to your mail. If you set up your itlabs account to forward mail, the mail sent there will be resent to the address you indicated in the .forward file, and then will be deleted from your itlabs account. Be sure that your forwarding address is correct, otherwise all mail sent to you at the itlabs address, will be lost to you forever.

    3. Accessing Your "@umn" Mail From An Itlabs Workstation

      If you are working at a workstation and you wish to view your mail on your "@umn" account you may access it via a telnet session as you normally do from a pc or mac, or use the U of MN mail web site (www.mail.umn.edu). At the prompt enter:

      % telnet umn.edu

      After a moment, you will be prompted to enter your username and password, which will enter you into the same telnet session with which you are already familiar.

  • Other Issues And Concerns
    1. The screen display described here may vary slightly based on the default set-up of your account. If the display is vastly different from that described here, please see the lab attendant for help on opening a UNIX shell window.

    2. The "vt100" was a computer terminal of the 1980's manufactured by the Digital Equipment Corporation. They became so popular that they became an unofficial standard for terminal set up.

    3. You have access to two separate file areas: your personal area and a class area. You may save files for as long as you are enrolled at the University in your personal area, but the space is limited and can not be increased. The class area provides more space but will be erased at the end of the semester. I suggest you work in the class area and copy only the files you wish to save for the long term to your personal directory. The class directory is issued by entering the command:

      %cd /class/myname

      where your actual user name should be substituted for "myname".

    4. Further Reading

      If you have other questions, or would like a more portable reference, a good purchase is:

      Learning the Unix Operating System by Todino, Strang, and Peek, published by O'Reilly & Associates, Inc.

      This text is listed as a suggested book for the course ME2011, and can also be found in the computer reference section of the university bookstore or check out in the lab.

 
The University of Minnesota is an equal opportunity educator and employer.