Gribskov & Smith

 BIMM 141 Laboratory

Spring, 2001

Introduction to Bioinformatics

 

 

Exercise 1

Use of Unix Computers

 

Exercise 1 is an introduction to the Unix computers used in this course and how to use them to perform the Lab Notebook associated tasks for this course (see BIMM 141 Course Objectives). The Exercise includes an introduction to the Internet and how to save images as gif files.

The objectives of this exercise are:

 

Specifically Relevant Articles:

There are no specific articles from the BIMM 140 Course Reader of particular relevance to this introductory Unix-based Exercise.


Baxevanis-Ouellette, 2nd Edition, Textbook Relevant Chapters:

 


Unix books:

In addition, for students who wish supplementary information or to learn more about the Unix operating system, there is a wide variety of books available and there are useful Web sites as well.

The following are a few of the many books available on Unix:

O'Reilly books (the definitive series for Unix ...) ... these plus many more specialized books:

Unix Web sites:

The following are a few of many Web sites presenting the essentials of Unix.

 

To do Exercise 1:
As described in the Exercise Web page under "Lab Notebook files", you will create your Lab Notebook file for Exercise 1 using Netscape Composer, a program within Netscape Communicator for the creation of Web pages. Your Lab Notebook for Exercise 1 will thus be a Web Page, i.e. a text html file, with images present as separate gif-formatted files. These will be in the exer1 subdirectory of your BIMM 141 account (you will create these subdirectories using Unix commands described as part of this Exercise 1 below).
Specific instructions are as follows - you can do these in a new Netscape Navigator window, as you read the instructions in this Netscape Navigator window - use the New command in the File pulldown Navigator menu):

  1. Login to your BIMM141 account on one of the Sun Unix computers in 4306 York Hall
  2. Turn on Netscape Communicator, which will turn on the browser Netscape Navigator by default
    1. In a Console or Command Line window, type in the command: nscomm
    2. This will bring up the ACS Home Web Page in NS NAvigator as the default Home Page
  3. Go to the Exercises part of the Exercises Web page for BIMM 141.
    1. Click on the Class Web Sites link.
    2. Click on the courses link.
    3. Click on the BIMM 140 link for Spring, 2001.
  4. Click on the Exercises Web page for BIMM 141, click on the Exercises part, and click on Exercise 1.
  5. Click on Template for Exercise 1 - this will bring up the Template or Foundation part of the Exercise 1 (all of the text present as {italicized bold text within curly brackets} ).
  6. Save this as a file in your account:
    1. Go to the File pulldown menu and select: Save Page as ...
    2. Follow instructions in the popup menu; name the saved Page file something like: exer1.html
  7. Open Netscape Composer by choosing Composer from the Communicator pulldown menu.
  8. Close the blank Composer file and Open your saved Exercise 1 Template file.
  9. Use this to construct your Lab Notebook file for Exercise 1 as you actually do Exercise 1.
  10. Answer the Questions at the end of the Exercise as you proceed through the Exercise

Thus, in actually doing an Exercise, you will have at least three windows open simultaneously:

  1. Netscape Composer - the window is which you do your Exercise by making the file exer1.html starting from the saved template for Exercise 1.
  2. Netscape Navigator - first Navigator window, open to this page, the Exercise 1 Web page, for instructions on what to do for Exercise 1.
  3. task window - window for execution of the tasks requested in a given Exercise. For Exercise 1, this will be different windows depending on which part of the Exercise you are doing:
    1. The File Manager window, for doing the Unix Tutorial
    2. The Console or Command Line window, for doing Unix vi Editor and Command Line prompt tasks.
    3. Netscape Navigator - a second Navigator window, for execution of the Part B tasks of Exercise 1. This is turned on in one of two general ways:
      1. via the New Navigator command from the File menu from within NS Communicator
      2. by again executing the nscomm command in a new Console or Command Line window; to get such an additional Unix Command Line window, do as described below.

Note: some of the Links in the Exercise are set to open a second NS Navigator window automatically for you.

 



BIMM 140: | Main | 140_Info | Syllabus | Lectures | Exams | DNASYSTEM | CMS MBR |
BIMM 141: | Main | 141_Info | Syllabus | Exercises | DNASYSTEM | CMS MBR |



Main Specific Tasks to Perform in Exercise 1:

A. Use of Unix Computers
1. Introduction to Unix Computers: Sun Ultra10 Unix Computers
a. 'Logon' to your Account
b. Save the Exercise 1 Template as an *.html File in your Account
c. Use Netscape Composer in Netscape Communicator to do Exercise 1
d. Begin to do Exercise 1
e. Do the Tutorial "Introducing Your Desktop"
f. Do the Tutorial "Moving Text"
g. Do the Tutorial "Managing your Work: Files, Folders"
h. Opening additional Command Line Windows, and Help in general
2. Introduction to the Gateway Linux and SGI O2 Iris Unix Computers
a. Linus Gateway Computers
b. Silicon Graphics (SGI) O2 Iris Computers
3. Introduction to the Unix vi Editor
4. Use of standard Unix commands at Command Line prompt
a. Commands for Your Account: pwd, ls -alF, man
b. Commands to Create Text Files and Subdirectories: vi, cat, mkdir
c. Commands to Move between Subdirectories: cd
d. Commands for Renaming, Moving, Copying, and Deleting Files: mv, cp, rm
1) Use of the mv Command to Move a File without Renaming It
2) Use of the Unix cp Command to Make a Copy of a File
3) Use of the Unix rm Command to Remove or Delete Files
e. Commands for Interacting with Other Computers: telnet, rlogin; ftp
1. Use of the telnet or rlogin Command to Connect to a Second Computer
2. Use of the ftp Command to Transfer Files between Two Computers
f. Additional Useful Unix Commands: date, who, logout
B. Netscape and the Internet
1. The DNASYSTEM Home Page
2. Saving Images for Lab Notebook files
C. Questions

 

Exercise 1

Introduction to Unix, Use of Unix Computers, and the Internet

Use of Unix Computers, with Emphasis on Sun Solaris Computers

The computer laboratory used for BIMM 141, Spring, 2001, is 4306 York Hall, a computer lab with 15 Sun Solaris Ultra10 computers, 5 Gateway PCs running under Linux, and 5 SGI O2 Unix computers. This Exercise addresses the issues of how to use these computers, with emphasis on the specifics of the Sun Solaris computers, how to create Exercise files, and how to submit these files for grading purposes.

 

{A. Use of Unix Computers}

In this part, you will log on to a Sun Unix computer, learn about the Windows system and how to use the 3-button mouse, and learn how to log out of the Unix computer.

This part of Exercise 1 focuses on the Sun Ultra10 Unix computers. The three types of Unix computers found in 4306 York Hall are all very similar to each, but with sufficient minor differences that the details of this Part A of Exercise 1 would be quite different for each type of computer. It is best to do at least Part A1 of Exercise 1 on one of the Sun computers.

With the knowledge so gained from this part of Exercise 1, you should be able to figure out fairly easily how to do comparable tasks on either the Gateway Red Hat Linux machines or the SGI O2 Iris machines.

Do the Tutorial part of Exercise 1 on a Sun Ultra10 computer. This is up through Part A1. Beginning with Part A2, if you wish to use a Gateway Linux computer or an SGI O2 computer, and figure out how the details of the Unix configurations differ, that would be fine. Some hints for doing this are provided below.

 

{1. Introcution to Unix Compters: Sun Ultra10 Unix Computers}

We assume you are sitting in front of a Sun Ultra10 Unix computer in 4306 York Hall. These are set up with your BIMM 141 accounts. The following operations are similar for other Unix computers and for other computers running the Linux operating system.

{a. Bring the computer out of 'sleep' mode by pressing any key and logon}

Type your User Name or Account Name in the box for User Name. This should be: bi141s**. Press Return
Now enter your Password into the box for Password. This will likely be your UCSD ID number.

If this is done properly, the screen will go blank, some caveats will appear, and then three "windows" appear. For the Sun Solaris Ultra10 computers, these three windows are:

1) cmdtool (CONSOLE) window:
This is the standard Unix prompt window for line commands typed in by the user at the prompt.
The prompt for the computers in 4306 York Hall look something like:    y4306-su-10.ucsd.edu%

2) File Manager V3.6 FCS window:
This window presents the Unix operating system as an icon-oriented file heirarchy system,
thereby permitting use of the mouse to do operations that, in the standard Unix console or line command window, require the User to type in commands. These operations include the following:
move between directories, open files, move files, see directory contents, etc

Thus, the File Manager lets users do things as they would with Mac and PC-Windows computers, whereas the line command Console window requires typed in commands like MS-DOS.

3) Help Viewer v3.6 FCS window:
This is a Help tutorial on "Introducing Your Desktop". Other Help tutorials are also available for these Sun Ultra10 computers.

Note that although you are working at a Unix computer in 4306 York Hall, you have actually logged into your BIMM 141 account on the "server" Unix computer insci14, an ACS computer physically located in AP&M on Muir campus.

This means that any files you create etc and save during your efforts on this computer will actually be saved in your account on the ACS Unix computer insci14.

This also means that you can continue to work on Exercise 1 (or any other Exercise) from any computer anywhere, so long as you have access to your BIMM 141 account, and hence can open up your Exercise HTML file using NS Composer. In particular, you can work further on your Exercise from ANY computer in 4306 York Hall.

 

{b. Get the Template for Exercise 1 as an .html file in your Account}

Exercises will be done on these Unix computers using Netscape Composer, one of the programs in Netscape Communicator. NS Composer permits creation of html files encoding simple Web pages. This is a convenient solution to the issue of electronic creation of Lab Notebook files, and of moving such files around for grading purposes.


{1) Turn on Netscape Communicator}

Move the mouse to the middle of the Console window and click the left button ("Selector" button).
You should now see a blinking cursor to the right side of the computer prompt.

Type in the command: nscomm
and press the RETURN key.

This should bring up Netscape Communicator in a new window; the ACS Home page is the default Web page.


{2) Go to BIMM 141 Exercises Web page in a new NS Navigator window}

To get a new NS Navigator window, do as described below ...
or click here for a new NS Navigator window opened to the ACS Home page.

From the ACS Home page in Netscape, click on Class Web Sites
Now click on MainWeb Course Listing
Now click on BIMM 140 ...

From the BIMM 140 Home Page, click on Exercises

Read the Information about the Exercises or Laboratory Notebook html files.


{3) Get a copy of the Exercise 1 Template File}

On the Exercises Web page, use the Outline to go to Exercise 1 and click on Template.
A copy of the Template for Exercise 1 appears in the Netscape screen; this is the file: exer1_skel.html

Click on the Netscape File pulldown menu and click on (select) Save as ...
A popup menu appears permitting you to save the Template as a file in your account.
Save it as an html source file, NOT as a text file, in your account;
Use the default filename exer1_skel.html as the filename.

This Template will serve as the "foundation of instructions" for your construction of the Lab Notebook file for Exercise 1.

 

{c. Use NS Composer in Netscape Communicator to do Exercise 1}


{1) Turn on Netscape (NS) Composer}

Click on the Communicator pulldown menu with the computer mouse
Move the mouse pointer to item Composer and select this with the mouse left button

NS Composer should come up, in a new window, showing a blank, new Web page.

{2) Bring up the Template for Exercise 1 in NS Composer}

Under the File pulldown menu in NS Composer, go to Open and select Page in Composer ...

Note: on Unix computers, the mouse cursor must be in the window you wish to use and the window must be selected (click inside the window somewhere ...).

A popup menu will appear that will permit you to select among *.html files in your account.
Select the Template file for Exercise 1 that you saved above in Step b3.

You should now see the Template file for Exercise 1 in the NS Composer window.
This will be your Exercise 1 main *.html file.

Note that you now have three windows open relevant to Exercise 1, two for NS Navigator and one for NS Composer ...


{d. Begin to do Exercise 1}

Follow the Instructions for setting up the Header information in your Exercise 1 file:
type in the Exercise Number, your Name, and your Account Name.
The "brief statement for each task in the Exercise" is already present in the Template.

Note that, by getting to this point, you have already done the above parts of Exercise 1!
So, in your Exercise 1 file in NS Composer, for these Parts a, b, c, d of A1, simply type in the statement Did this ... or something comparable ...

Be sure to do Save operations on your Composer Exercise file at regular intervals!
Unix computers do not "remind you to Save" ... and California has been having power problems ...

The above Procedures will be standard procedures for construction of Lab Notebook html files using NS Composer ...

Note that you will be writing your Exercise file in a Composer window at the same time as doing the tasks of the Exercise in other windows ...

 

{e. Do the Tutorial "Introducing Your Desktop}

By doing the Tutorial "Introducing Your Desktop", you will become somewhat familiar with various operations as performed on Sun Unix computers. Similar operations are present for the Linux and SGI Unix computers. You also will become somewhat familiar with the Lynx software used to move through the Tutorial; Lynx will be used again later in BIMM 141.

{Do the Help Tutorial on "Controlling the Mouse and Using Unix Windows"}

Place the Mouse cursor in the Help Viewer v3.6 FCS window and begin doing the Tutorial.
As you do the Tutorial, answer the Questions found at the end of the Template on "Controlling the Mouse and Using Windows".

Note that you are doing two tasks, 1) writing your Exercise File and 2) doing the Tutorial, at the same time, by shifting back and forth.
This is easily done using two separate Windows ... and shifting back and forth between the windows ...

You may initially have questions on how to do this!
For example: how do I bring a different window to the front? ...
Do the Tutorial! ... it will answer most of these questions ...



{f. Do the Tutorial on "Moving Text"}

Use the Exercise 1 html file you are creating using Composer, the file called exer1_skel.html, to do the text COPY-CUT-PASTE operations from the tutorial.

Use part of the Header information as the "text to select" and move it to here via COPY-PASTE.


{g. Do the Tutorial on "Managing your Work: Files, Folders"}

Use this section of the tutorial to:
1) create a new folder in your account called exer1_manager
2) save your Composer exer1_skel.html file in this folder and name this file exer1.html



{h. Opening additional Console or Command Line Windows, and Help in general}

What to do if you are lost ???? ... try the Help facility ... push function key F1 ...

{1) Explore elements of the Help facility}

It is often useful to run more than one program at the same time. Examples include 2 or more copies of Netscape Navigator, looking at 2 or more sites simultaneously on the Web (for example, running BLAST in one window; and browsing with a second window), plus running Netscape Composer with an Exercise, plus running one or more GCG programs, plus running other sequence analysis programs available on the Unix computers.

In some cases, each program runs from a separate Console window. One thus sometimes has the need to have multiple copies of Console windows open simultaneously. How to do this ??? ... there are at least 3 ways on the Sun Ultra10 computers:

 

{2) Create new Console windows using each of Three Methods}

1) Method 1 to open additional Console windows
In File Manager window, go to "Custom Commands" in File popdown menu ... choose "Unix shell" ...

2) Method 2 ... and better:

1) click the right mouse button on the background to bring up the Workspace popup menu
2) note the Programs available ... note also the pinning capability, to keep the menu displayed
a) use either Command Tool ... or Shell Tool ... to bring up a new Console window ...
3) use File Manager ... to bring up a new File Manager window ...

3) Method 3 ... also good:

1) click the right mouse button on the background to bring up the Workspace popup menu
2) note the Utilities available ...
3) click on Console ... to bring up a new Console or cmdtool window.
 
 
 

{2. Introduction to the Gateway Linux and SGI O2 Unix Computers}

These Unix or Unix-like computers are identical in their basic operations to the Sun Solaris Ultra10 Unix computers. However, the datails of the windows interface are different, and here we briefly examine those differences.

NOTE: When you logon to a Gateway Linux computer, you are logging into your account on the Linux server phcomp. This means that your Exercise 1 file is on a different computer, the insci14 computer.
The easiest solution to this problem is to use the put command in ftp to transfer your Exercise 1 file from a Sun computer to a Linux computer (actually from the insci14 server to the phcomp server).
This is precisely what you do in the ftp part of Exercise 1 below.
So it is a good idea to do the ftp part of Exercise 1 before doing the following Gateway and SGI parts of Exercise 1.

Do similarly for the SGI Iris O2 computers and their server, the nssgi-1 computer.

 

{a. Gateway Linux Computers}

These are Gateway PC computers running under the Red Hat Linux operating system. Linux is free, and highly similar to the Unix operating system. Red Hat is the most popular version of Linux.

{1) Login to a Gateway Linux Computer in the KDE Windows Environment}

The KDE environment stands for K Desktop Environment. This is intended to provide "user-friendly Unix computing" and is an environment something like the Sun Desk Manager.

{2) Examine the Icons at the bottom of the Screen}

Double-clicking with the mouse on the Book-! icon brings up several tutorials
The Netscape icon brings up a new Netscape Communicator window showing NS Navigator
The shell-Terminal icon brings up a new Shell or Console window ...

Thus, it is very easy to get new NS Communicator or Shell windows under Red Hat Linux ...

{3) Quickly go through the Tutorial "A Quick Start Guide to the Desktop"}

This Tutorial is similar to the Sun Tutorial called "Introducing Your Desktop".
Having done the Sun "Introducing Your Desktop" in A1e above, this should be quick and easy for you
Simply say "did this ..." in your Lab Notebook when you are finished.

The point of doing this Second Tutorial is to show you how quickly one can go through such a software tutorial when one already knows most of what is there; it is a fast way to learn what is new in the similar software.

There are similar Tutorials to the Sun Moving Text and Managing your Work tutorials;
quickly go through these as needed ...

 

{b. Silicon Graphics (SGI) Iris O2 Computers}

These are the Silicon Graphics computers. SGI Unix computers remain the standard for 3-dimensional Unix imaging work, and these will be used for Protein Modeling later in BIMM 141. Iris is the SGI version of Unix.

{1) Login to an SGI O2 Iris Computer}

The Iris environment automatically comes up. This is intended to provide "user-friendly Unix computing" and is an environment something like the Sun Desk Manager.

{2) Examine the Options in the Toolchest}

This Menu approach provides a great deal of functionality.
Note how one can get a new Netscape Communicator window from the Toolchest
Note how one can Open Unix Shell from the Desktop "drop-right" menu, to get a new Command Line window.

There appears to be no real online tutorial for the SGI workstations.
However, there are the following:

{3) Examine the Options under Help in the Desktop}

Examin in particular the topics Hints and Shortcuts and Short Answers ...
Also note the OnLine Books under the Help menu ... lots of documentation in the IRIS InSight Library

 

 

{3. Introduction to the Unix vi Editor}

The BIMM 141 Exercises will be done using the Composer program of Netscape Communicator, thereby creating text files with html code permitting direct visualization using a Web browser. This is a most convenient way of creating text files on Unix and any other computer capable of handling Netscape Communicator. Display and visualization likewise is possible on any computer that can use standard Web browsers. All of this is called "platform independence", both for creation and execution.

However, other editors exist for Unix machines. The Sun Ultra10 computers have a text editor called Text Editor. This may or may not be common to other Unix computers. The original "VIsual editor" for Unix computers is called the vi editor and is common to all Unix computers. The vi editor is a robust editor, full of interesting and strange commands, and people who have learned this well can do text editing very rapidly and efficiently. However, the learning curve to reach this point is very steep, and most people use more straight-forward solutions. Nevertheless, the vi editor is very useful for doing simple and quick editing types of operations, and one need learn very few commands to get to this point.

The following are ALL of the vi commands used by Smith in doing such simple operations:

 

{a. Create a file called exer1.vi using the vi Editor}

Use the above commands to create a small file called exer1.vi using the vi editor.
The text you include is not really important. You can type in one of the above paragraphs or couple of sentences ... or just something like "Here comes some text entered into this file after using the a command to add new text". The important thing is to get a little practice at each of the operatiosn in the above crib. If you really screw up, you can start over.

Notice that there are two modes to the vi editor:
1) text entry mode, the mode you are in after an a or i command ...
in this mode, ANY text or alphanumeric characters will appear in the text.
2) command mode, the mode you are in after you do a : in text entry mode

Takes a little practice ... and a LOT of care and attention when learning ... but is actually very useful ...

 

{4.Use of standard Unix commands at Command Line prompt}

The use of the File Manager in general simplifies use of the Unix command language, since common operations can now be done using the mouse and mouse-based operations. However, a mouse is available only at the "console" of a Unix machine, or from a computer logged into a Unix machine that is running software capable of emulating the X-Window Unix interface, eg MacX from Mac computers or Hummingbird eXceed from PC computers.

When one simply uses telnet or rlogin (remote login) to login into to Unix computers from other computers, or ftp to transfer files from a Unix computer to an initial computer, one must use standard Unix commands at the Command line prompt.

There are only a relatively few Unix commands needed to do most operations on Unix machines.
Many of these are as follows. Additional ones can be found as needed in Unix books or at Web Unix sites:

 
pwd _____________ Shows what directory you are in currently
ls ______________ List the file contents of the directory you are in currently
ls -alF _________ More extensive list, with file sizes etc ...
more <fileName> _ Examine text file contents of name <fileName>,
    one page at a time, from the beginning
RETURN ________ pressing return displays the next line of the contents of the text file
SPACE BAR _____ pressing the space bar displays the next page of the text file contents
Q key _________ pressing the Q or q key quits the more command, returning to the % prompt
tail <fileName> _ Examine the contents of <fileName> FROM THE END of the file upwards
cat <fileName> __ Examine the contents of <fileName> all at once, from beginning to end
 
mkdir <dirName> _ Make a new subdirectory of name <dirName>
cd <dirName> ____ Change current directory to subdirectory of name <dirName>
cd .. _____ Go to the directory immediately above the current one
cd ________ Go to your Login directory
 
mv <source_filename> <target_dir>/<target_filename> _________________________
Move file of filename <source_filename> from current directory
to directory <target_dir> and give it a new filename <target_filename>
mv <source_filename> <target_dir>/ ___________________________________
Move file of filename <source_filename> from current directory
to directory <target_dir> and keep the original filename <source_filename>
mv <source_filename> <target_filename> _______________________________
Rename file of filename <source_filename> to new filename
<source_filename> and leave the new file in the original subdirectory.
cp <source_filename> <target_dir>/<target_filename> _________________________
Copy file of filename <source_filename> from current directory
to directory <target_dir> and give the copy a new filename <target_filename>
cp <source_filename> <target_dir>/ ___________________________________
Copy file of filename <source_filename> from current directory
to directory <target_dir> and keep the original filename <source_filename>
cp <source_filename> <target_filename> _______________________________
Copy and Rename file of filename <source_filename> to new filename
<source_filename> and leave the new file in the original subdirectory.
rm <fileName> ___ Delete the file of name <fileName>. BE CAREFUL HERE!!!
 
telnet <system> _ Connect via telnet to another computer system called <system>,
rlogin <system> _ Remote Login; same as telnet command
ftp <system> ____ Connect via ftp to another computer system <system>,
passwd __________ Procedure to change your password
date ____________ Display the date and time
who _____________ Display who is currently logged on to the Unix system
 
logout __________ Log out from the Unix machine

 

{a. Unix commands and Your Account: pwd, ls -alF, man}

When you "login" to your Account on the Unix machine insci14, you are in a "subdirectory" or "folder" in the file heirarchy system on the computer (all information is found in files which reside in subdirectories; a given subdirectory is itself a file). Your Account subdirectory is your main directory or home directory; you can create subdirectories and thereby organize your files within your home directory. We will do this, creating a separate subdirectory for the files for each Exercise.

{Briefly describe in your Lab Notebook what happens with each of the following operations}

{At the % prompt, do: pwd}
The pwd command (Present Working Directory) tells you where you are (what directory you are in ...)
You should see something like: /home/solaris/nsci/bi141s/bi141s**
This is the subdirectory structure; the last item, the bi141s**, is your home directory; this directory is a subdirectory of directory bi141s is a subdirectory of directory nsci ... etc etc.
This is the Unix file heirarchy system.

{At the % prompt, do: ls}
The ls command (LiSt) lists most of the files within your current directory.
You should see the names of the files you created in your efforts above, for example:
exer1_manager exer1_skel.html

Most Unix commands have qualifier commands, to enhance the capabilities of the command.
To learn what these qualifiers are, you can check out Unix books or Unix Web sites, or you can use the Unix manual which is present on all Unix machines. To use the Unix manual for a command, do at the % prompt: man <command>

{At the % prompt, do: man ls}
This is the typical structure of manual documentation: name, synopsis, description, etc etc for the command.
Under SYNOPSIS, note all the letters after the hyphen - ... these are all qualifiers to the ls command.

NOTE: UNIX is Case Sensitive! ... qualifier -a is different from qualifier -A !!!
NOTE: nearly all Unix commands are in lower case ... but qualifiers are sometimes UPPER case

Note also that one page of the documentation has come up on the screen, with a --More--(**%) indicator at the bottom of the page. The percent shows how much of the document has been desplayed.

more command: this is typical of the more command ...
1. To display the next line in the document, press: RETURN
2. To display the next page in the document, press: SPACE BAR
3. To exit or quit the man display of the document, press: Q key

The OPTIONS are described later in the man document ...

{At the % prompt, do: ls -al}
The a qualifier causes display of All files, including those that begin with a period (these are "hidden" files ... for example, the .cshrc and .login files set the Unix computer environment for you when you login, much like the PC autoexec.bat file)
The l qualifier causes Long display: a full line of information about each file ... The first column gives file previleges, except for the first letter which, if a d, indicates the file is a directory, else it is a text or binary (executable) file; the next three columns indicate mode, and owners of the current directory and file; 5th column is file size in kbytes; next 3 columns are date and time of last modification of the file, and last column is the file name.

{At the % prompt, do: ls -alF}
The F qualifier makes it easier to determine the type of file, with the following main types:
1) a / after the filename indicates the file is a directory file
2) a * after the filename indicates the file is an executable file (ie, a program)

 

{b. Unix commands and Creating Text Files and Subdirectories: vi, cat, mkdir}

You often wish to create files in your Account including text files and subdirectories.

Text Files:
You have already seen two ways for creating text files on Unix computers:
1) Use of Netscape Composer to create Web-formatted html text files, for use with Web browsers.
2) Use of the Unix vi editor.

A third way to create quick and dirty small files is to use the Unix cat command coupled with redirect of output to a new file.

{Do at the % prompt: cat > short.txt}
This will now permit you to type in whatever text you wish.
You can correct errors on any given line ...
but once you do a RETURN you go to the next line and can not correct earlier lines.
Do this for 3 or 4 lines, and then stop the editing by doing: ctrl-D
This should restore you to the % prompt.

{Now do at the % prompt: cat short.txt}
Since the file short.txt already exists, this cat command will now display the contents of the file.
These contents should be what you just typed ...

 

Subdirectories:

Subdirectories or Folders are used to organize ones files. A good way to do this in BIMM 141 is to have separate subdirectories for each Exercise; then instructors can easily determine which files are relevant to a given Exercise.

Here we will create Subdirectories for Exercise 1 and for Exercise 2; these will be called exer1 and exer2.

{At the % prompt, do: mkdir exer1}
{At the % prompt, do: mkdir exer2}
These mkdir (MaKe DIRectory) commands have created the two directories exer1 and exer2, each as a subdirectory of your home directory bi141s**.
To see that all is well, do pwd ... you should be in your bi141s** home directory.
Now do ls -alF ... you should see the two new directory files, exer1 and exer2, in addition to the previous files.

 

{c. Unix commands and Moving between Subdirectories: cd}

Having created subdirectories, you often wish to move between these subdirectories, to work in a given directory.
To do this, one uses the cd (Change Directory) command.

{At the % prompt, do: cd exer1_manager}
You have now moved to the exer1 subdirectory ...
To confirm this, do pwd ... you should see something like: /home/solaris/nsci/bi141s/bi141s**/exer1_manager
Now do: ls -alF
You will see two directories, the . and .. directories, plus the file from the above Tutorial called exer1.html.
The . directory is always your current directory (in this case, the exer1 directory).
The .. directory is always the parent directory to your current directory (in this case, the bi141s** directory).

We now return to your home directory, which is the parent directory of the exer1 directory, your current directory:

{At the % prompt, do: cd ..}
Confirm that you have moved up one directory in the directory heirarchy, to bi141s**, by doing: pwd

{At the % prompt, do: cd exer2
confirm where you are; do: pwd}
You should be in the exer2 subdirectory ...

{Now do at the % prompt: cd ../exer1
confirm where you are; do: pwd}
What happened here?? From the exer2 directory, the .. took you up to the parent bi141s** directory, and the exer1 took you down to the exer1 directory.

{At the % prompt, do: cd}
{confirm where you are; do: pwd}
Where are you ??? The cd command by itself with no arguments simply returns you to your home directory.

 

{d. Unix commands and Renaming, Moving, Copying, and Deleting Files: mv, cp, rm}
One often has a need to rename or move or remove (delete) files from ones Account and its Subdirectories.
To do these operations, you will use one of three Unix commands:
1) the mv (MoVe) command, 2) the cp (CoPy) command, or 3) the rm (ReMove) command.

The mv command can both rename a file and/or move a file to a new subdirectory.

 

{1) Use of the Unix mv command to Move a File with no Rename Operation}

{At the % prompt, do: cd}
This will put you in your home directory, if you are not already there.

{Now do at the % prompt: ls -alF}
At this point, you should see something like the following:

drwxr-s--- 5 bi141szz bi141s 4096 Mar 22 10:26 ./
drwxrws--- 9 bi141szz bi141s 4096 Mar 22 08:29 ../
-rw-r--r-- 1 bi141szz bi141s 15296 Mar 21 11:18 bimm140_info.noInc.html
drwxr-s--- 2 bi141szz bi141s 4096 Mar 22 09:52 exer1/
-rw-r----- 1 bi141szz bi141s 131 Mar 22 10:19 exer1.vi
drwxr-s--- 2 bi141szz bi141s 4096 Mar 22 10:16 exer1_manager/
-rw-r----- 1 bi141szz bi141s 131 Mar 22 10:26 exer1_skel.html
drwxr-s--- 2 bi141szz bi141s 4096 Mar 22 10:15 exer2/

These are files and subdirectories that you created in steps above in this Exercise 1.

{At the % prompt, do: mv exer1.vi exer1/}
Note the syntax used by the mv command: mv source_filename target_dir/target_filename

If the filename does not change, one leaves out the target_filename name: mv source_filename target_dir/
If the directory does not change, one leaves out the target_dir name: mv source_filename target_filename

So all you have done here is move a file from one directory to another ...

Confirm that this is what has happened by doing the following:
{At the % prompt, do: ls -alF}
File exer1.vi should be absent from your home directory ...
{At the % prompt, do: cd exer1}
{do: pwd}
{do: ls -alF}
File exer1.vi should now be present in your exer1 subdirectory ...

{Return to your home directory; do either: cd
or do: cd ..
and confirm where you are ...}

You now will both copy and rename file exer1_skel.html to subdirectory exer1

However, you will first need to close the file ... because the file is currently open and you are working on it in Netscape Composer!!! ... one cannot move or copy files that are open and being worked on ...

 

{2) Use of the Unix cp command to Make a Copy of a File}

The cp command is used to make a CoPy of a File; the copy can be of different name in the same Directory, or it can be in a different Directory, with either the same name or a different name.
Note: the complete name of a file includes the entire directory tree ... hence two files with same filename that reside in different directories have different complete names ... and this is ok under Unix.
For example, the complete name of your file exer1_skel.html is:

/home/solaris/nsci/bi141s/bi141s**/exer1_skel.html

Copy down the following cp command and instructions on a piece of paper, and save and close your Exercise 1 file from NS Composer. Then do the following cp command. This will give you a copy of your Exercise 1 file called exer1.html present in subdirectory exer1.

Then go to your subdirectory exer1 (do: cd exer1), and open up your Exercise 1 file called exer1.html in NS Composer. This is the Exercise 1 file you will use for further work.

Syntax for the cp command is very similar to that for the mv command: cp source_file target_dir/target_file

{At the % prompt, do: cp exer1_skel.html exer1/exer1.html}
This will give you a copy of your Exercise 1 file called exer1.html present in subdirectory exer1.

Note that you have copied your Exercise 1 file to a new Directory and given the file a new name.
One can also do these operations separately with the cp or with the mv command.

{return to your home directory - do: cd}
{At the % prompt, do: cp exer1_skel.html exer1_skel.html-copy}
Confirm using pwd and ls commands that you have made a copy called exer1_skel.html-copy of your file exer1_skel.html.

{Now do at the % prompt: cp exer1_skel.html-copy exer1/}
Confirm using cd, pwd, and ls commands that you have made a copy of file exer1_skel.html-copy in subdirectory exer1 having the same filename.

 

{3) Use of the Unix rm command to Remove or Delete Files}
Now delete these files exer1_skel.html-copy from your Account, since you won't need them.

Use commands cd, pwd, and ls to go first to subdirectory exer1 and then to your home directory, and in each execute the following rm command:

{At the % prompt, do: rm exer1_skel.html-copy}

Note the finality of this operation ... once a file is deleted, it is gone forever ... the insci14 Unix server is set up to prompt you if this is really what you want to do !!

 

 

{e. Unix Commands and Interactions with Other Computers: telnet, rlogin, ftp}

A common way to login and use a second computer from a first computer is to use telnet or rlogin.
rlogin
is a Unix command that is essentially the equivalent to the telnet command; either work from Unix machines. In addition, telnet emulation software exists for microcomputers ... the NCSA telnet software is often used on either PC or Mac computers.

Similarly, a common way to transfer files between computers is to use ftp (File Transfer Protocol). As with rlogin or telnet, ftp was created as a Unix command (this means that software was written that would perform this task and this software was added to the Unix set of utility software). The ftp software has been adapted to microcomputers and is available for PC and Mac computers often as part of other software packages; the Dartmouth Fetch program is often used with Mac computers.

Recall that when one uses the Unix computers in 4306 York Hall, one actually logs into an Account on one of three server computers for these 4306 computers. Recall also that these server computers are:

Thus, in the telnet and ftp operations below, we telnet and ftp to these server computers.

 

{1) Use of Unix telnet or rlogin Command to Connect to a Second Computer}

{At the % prompt on a Sun computer, type: telnet phcomp}

***Note: telneting did NOT work from home to linux boxes ... check this out in 4306!!

You are now logged into the Gateway Linux server computer phcomp.

The result of this telnet operation is that you can now do on the second computer everything that you could do as if it were the first computer. And you can do nothing on the first computer until you log off the second computer.

Note the new prompt! ... the prompt tells you the name of the computer you are logged into ...

You can continue to do this telneting:

{At the % prompt, type: rlogin nssgi-1}

You are now logged onto nssgi-1, with appropriate prompt ... you have logged onto a third computer.
This is the server computer for the SGI O2 Iris computers.

{At the % prompt, type: logout}

You have logged off of the third computer ... and have returned to the second computer.

{At the % prompt, again type: logout}

You are now back to the first computer, the Sun from which you began.

Note that if you wish to work on a file in your insci14 account, accessed from any of the Sun computers in 4306 York, but you do not have access to one of the Sun computers (they may all be in use by other students ...), you can log on to any of the Linux or SGI computers and then telnet over to insci14, the server for the 4306 Sun computers.

 

{2) Use of Unix ftp Command to Transfer Files between Two Computers}

{At the % prompt on a Sun computer, type: ftp phcomp}

***Note: I could not ftp to any 4306 computer after logging on from home ...
BUT ftp DID work to phcomp ... and to nssgi-1

You will now log in and then get to a new prompt: ftp>

You are now logged on to computer phcomp, the server computer for the Gateway Linux computers, and are ready to transfer files between the first Sun computer and the second Linux computer (actually, between accounts on the two servers insci14 and phcomp).

{At the ftp> prompt, do: ?}

You now see all of the commands available to you. Most are obvious... but not all. We will use only a few of these. put and get are the two major commands.

Do help <command> to get a brief statement of the function of Command <command>
Example: help rename

{At the ftp> prompt, do: pwd}
{At the ftp> prompt, do: ls}

Many of the standard Unix commands work, giving you information about the Account and Computer that you used ftp to get to (second computer).

{At the ftp> prompt, do: binary}

This tells the ftp software that you plan to transfer files with embedded formats. Examples of such files are image files (eg, gif or jpeg files), MS Word or Excel files from PCs or Macs that were not saved as text, Photoshop files, etc etc. Text files can be transferred as binary files, but most people use 'ascii'.

{At the ftp> prompt, do: ascii}

This tells the ftp software that you plan to transfer plain text or "ascii" files. HTML files are examples of such files.

{At the ftp> prompt, do: put <filename>
where <filename> is the name of a text file you have in your Sun account, eg your Exercise 1 HTML file}

This command will "put" the file of name <filename> from the first computer (the Sun - actually, the server insci14) to your account on the second computer (the server phcomp)

{At the ftp> prompt, do: ls}

This should confirm that the put operation was successful.

Some of the ftp commands are different from standard Unix commands.
For example, rename is used instead of mv to rename a file.

Here we use rename to change the name of the file you just transferred:

{At the ftp> prompt, do: rename <filename> <new_filename>}

Confirm the change:

{At the ftp> prompt, do: ls}

Now transfer this file of name <new_filename> back to your first computer, the Sun computer:

{At the ftp> prompt, do: get <new_filename>}

These are the essential ftp operations.

Note:

Finally, terminate your ftp session:

{At the ftp> prompt, do: quit}

This should return you to your Sun prompt.
You can now confirm the last get operation with an ls command;
the file of name <new_filename> should be in your Sun account.

 

 

{f. Additional Useful Unix Commands: date, who, logout}

{At the % prompt, do: date"}
This command displays the current date and time

{At the % prompt, do: who"}
This command displays who else is logged on to the Unix system.

{At the % prompt, do: logout"}
This command logs you off the system.

 

 

{B. Netscape and the Internet}

Use of Netscape and the Web to Find and Retrieve Sequences

Sometime around 1994, the Internet, originally part of the US defense establishment as ARPANET, began to be available for non-military use. Several initial ways of doing things, including Gopher, Archie, WAIS, and WWW, distilled down to use now essentially of WWW or Web technologies. A simple "HyperText Markup Language" (HTML) was developed for the Web, and browsers created to interpret and display "html files". Initial browsers such as NCSA Mosaic has nearly all been completely superceded by Netscape and MS Internet Explorer.

The Web has had a profound effect on how Bioinformatics is done. Powerful "software tools" and applications, in addition to databases, became increasingly available "on the Web". HTML underwent significant and rapid development, and incorporated ways of using more advanced languages including Java and JavaScript, as well as use of Perl and C for construction of "cgi files". These developments increased the utility of the Web such that input parameters can be entered in the execution of programs on the Web, security measures can be incorporated (none of which are perfect!), direct interactive communication is possible ("chat rooms") in addition to email, as well as file transfer procedures (usually ftp or File Transfer Protocol). The hypertext features underlying the Web, whereby one can instantaneously access data and programs found in any type of computer anywhere in the world, have provided a default operational mechanism for a federated collection of databases and software tools. More interactive media including sound and movies is currently enjoying a heyday of development. Developments continue as well in the physical media involved, including fiber optic delivery via Cable companies and the "ultra high speed Internet".

With the advent of "whole genome" biology, Molecular Biology is entering and proceeding through yet another revolution. Researchers are doing experiments in which data reflecting effects on thousands of genes are gathered simultaneously! The day of examining one gene at a time is fast coming to a close. These changes in the way in which molecular biology experiments are performed are occurring simultaneously with changes in the fundamental information about any given organism: complete information concerning the primary structure of the genome (nucleotide sequence) is now know for over 40 bacteria and archae, as well as for several eukaryotic organisms, from yeast to human. Both of these changes, whole genome biology and genome information, are resulting in massive increases in data available, and a primary thrust of present day Bioinformatics concerns these data: how to make them available to users? how to interpret the data? how to relate the data to fundamental biological processes? how to use the data for advances in biomedical and agricultural sciences?

Use of the Web for both 1) access to the data and to various transformed or reinterpreted versions of the data, and 2) to software tools for further analysis of the data is a fundamental feature of this revolution in molecular biology. As a specific example, sequence DNA and protein sequence databases are by-and-large no longer maintained at individual universities. Rather, specific centers such NCBI, EBI, and ExPASy maintain these sequence databases. New sequences are submitted to these centers, where developed software immediately makes the new sequences available to the public. Further, these centers have developed software tools for analysis of data in these databases, as well as new ways of interpreting and displaying such data; further developments in these areas continues at a frenetic pace.

These changes have had a profound effect on BIMM 140, and now BIMM 141, over the years. BIMM 140 started out as a course which used a VAX VMS computer as repository of programs and software tools, as well as sequence databases. Students performed Exercises using terminals (VT52 or VT100) to access accounts on this VAX VMS "minicomputer". Microcomputers existed as rudimentary PC XT or Apple II computers; neither Macs nor the Internet existed. Exercises were submitted for grading as "hard copy" prinouts from the VAX via LinePrinters. Graphics was very difficult or impossible. The BIMM 141 laboratory course now uses for the first time a Unix computer laboratory, preparatory to development of a full-fledged Bioinformatics Major at UCSD, in which students will learn computer science to complement their learning of biology. BIMM 140, BIMM 141, and BIMM 142, not yet taught, will have students with such preparation, permitting the instructors to do much more particularly in the laboratory course. Use of Unix computers is a step in this direction, and BIMM 141 as taught Spring, 2001, will involve no programming. However, the Web will be used extensively: 1) for access to data such as sequence data from NCBI databases; 2) for execution of software tools and programs such as BLAST and FASTA; 3) for access to transformed data such as COG information and human genome information through LocusLink, UniGene, or MapView links; and 4) not least, for the logistic construction of the Exercise Lab Notebook files per se, using the html editor Netscape Composer to construct Lab Notebook files on the Unix computers as Web html files per se, with grading of these files done using html editors.

As a result of both the revolution occuring in genomic biology, and the rapid developments associated with both the Web and with Bioinformatics, this BIMM 140 /141 course is changing significantly every year.

In this final part of Exercise 1, we use the Web to retrieve some graphics form the DNASYSTEM Home page or some other Bioinformatics Web Site which will be saved as a *.gif file for submission with the *.html text file as part of Exercise 1. This exemplifies how graphics will be submitted as "part of the Lab Notebook" in Exercises for the rest of the BIMM 141 course.

 

{1. The DNASYSTEM and CMS MBR Web Sites}

Go to the DNASYSTEM Home Page and browse around some.
This Home Page, or others like it such as the SDSC CMS MBR (Molecular Biology Resource), are most useful for finding Bioinformatics sites for specific purposes.

Go to a site of interest using either the DNASYSTEM or CMS MBR Web pages or use these sites themselves for retrieval of a graphic image for Exercise 1, as follows:

 

{2. Saving Images for Lab Notebook files}

Having found an image you wish to include in your Exercise 1 Lab Notebook, you will now use COPY-PASTE operations to retrieve the Image as a *.gif file from a Web page.


{a. Place mouse cursor over image in Netscape window}

{b. Click right mouse button and select: Save image as ... }

{c. Save image in your directory exer1}
This is your directory with the html file exer1.html into which you wish to insert the image ...

{d. From the Insert pull-down menu in Netscape Composer, choose Image }

{e. Choose Browse to find your *.gif file, choose this, and click ok }
You should now see the image in you exer1.html file, e.g. as per the following:

or the following image of features of the Dictyostelium discoideum Alpha-L-Fucosidase gene, alfA, as adapted from the ACeDB genomic database for Dictyostelium called DictyDB:

 

 

 {C. Questions:}

{Answer all of the following questions:}

  1. What are the three Windows that appear when you log on to a Sun computer in 4306 York Hall?
  2. What computer are you logged onto? How is this computer related to those in 4306 York Hall?
  3. What is your home directory and what does this terminology mean?
  4. How does Netscape Communicator differ from Netscape Navigator? Which most closely resembles Internet Explorer?
  5. The BIMM 140/141 home page is the primary method of providing updated information to BIMM 140/141 students. What is the URL for the BIMM 140/141 home page?
  6. What is the purpose of the Template file for each of the BIMM 141 Exercises?
  7. What is the purpose of each of the three windows that you work with when doing a BIMM 141 Exercise?
  8. What does the Netscape Composer program do?
  9. Questions from Tutorial on "Controlling the Mouse and Using Windows":
    1. What are the three buttons of the Unix mouse, and what is each used for?
    2. What is a window?
    3. What is the difference between 'close a window' and 'quit a window'?
    4. What happens if with the Mouse left button you:
          click in the small square in the upper left corner of a window?
          double-click in the upper bar of the window?
          place the mouse cursur in the lower right corner, click, and move the cursor with the mouse?
          click on one of the arrows of either the horizontal or vertical
    5. How do you move a window?
    6. How do you move a window forward ahead of another window?
    7. How do you move a window backward behind another window?
    8. How do you resize a window?
    9. What are the seven operations for using the Scrollbar to move through a document?
    10. Are there any differences in these operations between Vertical and Horizontal Scrollbars?
    11. What is a popup menu? 
    12. Which button of the mouse brings up popup menus?
    13. Are the popup menus the same for different windows?
    14. What are submenus?
    15. What is the workspace?
    16. What is the workspace menu?
    17. What does "pinning the workspace menu" mean?
  10. Questions on "Moving Text":
    1. What are the keyboard commands for text COPY, text CUT, text PASTE? 
    2. How do these commands compare with those typically used on PC and Mac computers?
  11. Questions on "Managing your Work: Files, Folders":
    1. What is the difference between a folder and a subdirectory?
  12. Questions on the Unix vi Editor:
    1. What is the vi editor used for? vi stands for "VIsual"; how is this editor "visual"?
    2. What are the two modes of the vi editor, and what is each used for?
  13. Why is it often desirable to have more than one Command Line window opened simultaneously?
  14. Commonly, in doing Exercises for BIMM 141, what three types of programs will you be running simultaneously on your Unix machine?
  15. What does "pinning" of a Menu on a Sun Unix machine do?
  16. What are some of the File Manager "Utility" programs available? Note that these are X-Windows programs; what does this mean?
  17. Briefly describe the function of each of the following Unix commands and state what the comparable operation using the Sun Unix File Manager would be:
    1. pwd
    2. ls -al
    3. mkdir subdir1
    4. cd ..
    5. cd ../../subdir3
    6. cp file1 ../../subdir3/file1.backup
    7. mv file1 ../../subdir3/file1.backup
    8. who
    9. logout
  18. What happened when you executed the Unix command: telnet phcomp?
    What computer were you logged into after you logged in?
    What would have happened if you had executed: rlogin nssgi-1?
  19. What was the new prompt after you executed the Unix command: telnet phcomp?
  20. What computer were you are on in your telnet session after the first logout? after the second logout?
  21. Name two ftp commands that are identical to Unix commands and two which are different.
  22. What are the two primary ftp commands and what do they do?
  23. What is the Internet?
  24. How is the Internet important to these two courses BIMM 140 and BIMM 141?
  25. What is a "federated collection of databases", and why is use of such a collection of importance in modern-day molecular biology?
  26. What is "whole genome" biology?
  27. What is a "gif image"?

 

 


BIMM 140: | Main | 140_Info | Syllabus | Lectures | Exams | DNASYSTEM | CMS MBR |
BIMM 141: | Main | 141_Info | Syllabus | Exercises | DNASYSTEM | CMS MBR |


Latest modification: 29 March, 2001

If you have problems or questions, send email to Michael Gribskov, to Doug Smith, or to Hiren Patel.