| 
 Computer Science 322  | 
Lab 0: Getting Reacquainted with C and Unix
Due: 10:00 AM, Monday, February 4, 2008
      uname -a > linux.txt
This will execute the command uname -a, which prints a
variety of information about the system you are on, and redirects
the output, which would normally be printed in your terminal
window, to the file linux.txt.
      uname -a >> linux.txt
This is the same as what you did on your local Linux system, except
that we are using >> to redirect output.  The only difference
here is that instead of creating a brand new file linux.txt
(thereby overwriting the previous contents of the file), the command
will append the output of uname -a to the end of the file linux.txt.
      uname -a > cluster.txt
You now have a file cluster.txt, with some system information
about the cluster head node.
Look at the contents of the files linux.txt and cluster.txt.  Which information is different?  Can you guess what
some of the information in the two files might mean?
ls cd cp mv rm mkdir pwd man chmod cat more grep head tail ln find rmdir wc diff tarGive a one sentence description of each command in a file unix.txt.
C-x C-s C-x C-c C-x C-f C-x C-w C-g C-a C-e C-d C-_ C-v M-v C-s C-r M-%C- before a key means hold down Ctrl and hit that key. M- indicates the "Meta" key, which on most systems is Esc. To issue a Meta command, hit the Esc key, release it, then hit the key for the command you wish to issue. Use the keystrokes rather than the menus. It will save you time in the long run! Include a brief description of each Emacs keystroke in your file unix.txt. Learn these commands - you will use them often. Hints can be found in the Unix and Emacs web pages linked from the course website. Ask others in the lab if you're not sure how to do something in the Unix environment. Share your tips and tricks with each other. Note: when logged into the CS Lab Linux systems, Emacs will open in its own window and allow you to use the mouse to move the cursor and to operate the menus. When logging in remotely, you need to forward your X11 display to your screen. To do this from the CS Linux systems, you will need to add the -Y flag to your ssh command:
    ssh -Y mhccluster.teresco.org
Verify that you can display an Emacs window from mhccluster
to one of the CS Linux systems.  To get your prompt back (by
running Emacs - or any command for that matter - in the
background), follow your command line with an &.  This will
allow you to work in Emacs and your terminal window concurrently.
To transfer files from your Linux lab account to the cluster, you can use the scp ("secure copy") command. It works much like the standard cp command, except that you can specify hostnames for the source and/or destination files. For example, to transfer the file linux.txt from your Linux lab account to the cluster in a subdirectory cs322, open a terminal window and change to the directory that contains the file (say, cs322) and execute the command:
    scp linux.txt mhccluster.teresco.org:cs322
Alternately, you could log into mhccluster and issue the command in the opposite direction, with the same net effect:
    scp babyred.mtholyoke.edu:cs322/linux.txt .
The "." in the command indicates that the destination for the copy is your current working directory.
To submit this lab, use the turnin utility on the cluster head node, using the directions on the course home page. Please include the files linux.txt, cluster.txt, unix.txt, late.txt, make.txt, argadder.c, and Makefile in your submission.
Please use the exact filenames specified (for this lab and all semester) to make my job easier when gathering your submissions together for grading. You don't want to annoy your grader with misnamed or missing files just before he grades your assignment.