AiS Challenge


 

Unix

Topics: bbs, CC, cc, cd, cp, f90, .forward, java, javac, login, logout, ls, mkdir, pico, pine, rm, vi

bbs
The bbs (Bulletin Board System) command will take you into pine with a read-only folder that can be "posted" to by sending mail to bbs@mode.lanl.k12.nm.us or if you are on mode, just pine bbs will work. You can interact with other AiS Challenge participants, but remember that everyone sees what is posted to the bbs.

CC
The CC command will invoke the C++ compiler to compile a C++ program. The -o option will name the output file differently from the default name of a.out.
Example: CC -o project2 project2.c

cc
The cc command will invoke the C compiler to compile a C program. The -o option will name the output file differently from the default name of a.out.
Example: cc -o project project.c

cd
The cd command will change to another directory. If no directory is specified, cd will return to the home directory. When a directory is specified without a path, it is assumed to be a subdirectory of the current directory.
Example: cd public_html
If the directory is not a subdirectory, a full path must be specified.
Example: cd /usr/local/aisc/examples

cp
The cp command will copy a file from one location to another.
Example: cp /usr/local/aisc/examples/bacteria.f bacteria.f
or cp /usr/local/aisc/examples/bacteria.f .   where . indicates the current directory.

f90
The f90 command currently invokes the GNU F77 compiler on mode, but will invoke the SGI Fortran 90 compiler on pi, to compile a Fortran program. The -o option will name the output file differently from the default name of a.out.
Example: f90 -o solveit solveit.f

.forward
If you regularly read mail on a machine other than mode.lanl.k12.nm.us, please create a file called .forward that contains your email address on the other machine. Enter: pico .forward then put in your email address, like Joe-student@aol.com and save the file (^O ^X) and then TEST IT by sending mail to your mode account and see if that mail shows up at your other machine, if not look at your .forward file again.

java
The Java interpreter, sometimes reffered to as the Java Virtual Machine (JVM). Used to execute java programs (files that end with .class).
Example: java HelloWorld

javac
Use the javac command to invoke the Java compiler. It will translate files (ending with .java) of java source code and produce files of java ``byte code'' which will have a .class extension.
Example: javac HelloWorld.java

login
AiS Challenge account name begin with ch and are followed by the team number and the person's initials, ie ch001abc. For dialin access through the Technet phone numbers, use ch001abc@chall so that the terminal server knows to validate your password with mode.

logout
Don't forget to logout when you are finished using mode.lanl.k12.nm.us so that others will not bother your files and you will not use any system resources.
Example: logout

ls
The ls command will list the contents of the current directory. There are many options to the ls command which are discussed in the man pages (enter: man ls).
Example: ls /usr/local/aisc/examples

mkdir
The mkdir command will make a directory. This is a useful way to organize information. Use the rmdir command to remove an empty directory.
Example: mkdir reports research code

pico
pico is a very simple editor. It is the default editor for creating mail messages when using the pine mailer. It is always in "insert mode" and shows the possible control commands on the bottom of the screen. The arrow keys can be used to position the cursor and characters can be deleted with either the delete key or the backspace key.
Example: pico index.html

pine
pine is an electronic mail program that is very friendly and easy to use. It uses the PIne COmposer (see pico above) to create new messages. AiS Challenge email addresses are in the form of login_name@mode.lanl.k12.nm.us and mail should be read and sent from mode as opposed to pi. There is help on each screen of pine and possible commands are listed on the menu or across the bottom of the screen.

rm
The rm command will remove (or delete) a file that is no longer needed. Once a file has been removed, it can not be recovered so you might want to use the -i option which will ask for confirmation before the removal take place.
Example: rm -i a.out

vi
vi is the "standard" Unix editor found on every Unix machine. It is more powerful than pico, but is more complicated to learn. The best way to learn about vi is to read about it in a Unix textbook and try using it.
Example: vi solveit.f

For more information about Unix, look at the AiS Challenge Help page that is available online.

Unix Lab Exercises

  1. Logon to mode (mode.lanl.k12.nm.us)
  2. Do an ls command to see what files you have and make sure you have a file called UserInput.java and if you don't, execute the following command to get a copy for you to use during the java class:
    cp /usr/local/aisc/UserInput.java UserInput.java
  3. At the   mode:~>   prompt, create a directory called examples and change to it
    1. mkdir examples
    2. cd examples
  4. Copy the files bacteria.f, and sample.c from the directory /usr/local/aisc/examples into your examples directory with the following commands
    1. cp /usr/local/aisc/examples/bacteria.f bacteria.f
    2. cp /usr/local/aisc/examples/sample.c sample.c
  5. Look at the files you have with cat or more
    1. cat bacteria.f
    2. more sample.c
  6. Compile the C++ program with CC sample.c (2 capital "C"s) and run it by entering a.out
  7. Remove the a.out file created from above with rm a.out
  8. Check the Bulletin Board by entering bbs
  9. Change to your public_html directory by returning to your home directory with cd then enter cd public_html
  10. Edit your abstract page pico abstract.html and replace the generic information with your information. Then view it with a web browser, point it to http://mode.lanl.k12.nm.us/~chnnnabc/abstract.html where chnnnabc is your login name.
  11. One of your team members needs to edit the abstract.html file that is located in everyone's public_html directory with your team's information and once that is complete and spell checked (with ispell abstract.html), submit it to the AiS Challenge staff by entering submit abstract.html
  12. If you regularly read mail on an account other than your AiS Challenge account, please create a file called .forward (pico .forward) that contains your other email address. Make sure you test it by sending mail to yourself on mode.
  13. Using pine, send mail to your team members to establish a time this week to discuss what you learned at Glorieta.
  14. Use the man command to learn about some of the options to the ls command, enter man ls
  15. Logout of mode logout
  16. Point a web browser to http://www.challenge.nm.org and click on AiS Challenge Mail at the bottom of the logo. That will take you to a web based interface to email. Login, as you do to mode, and check your email.

October 2002
Document URL--http://www.challenge.nm.org/Archive/02-03/Glorieta/unix.shtml

 
Search the Challenge WebSite:  
Questions? e-mail: consult@challenge.nm.org