Thread View: concordia.class.bio461
1 messages
1 total messages
Started by Carolyn Beckman
Wed, 31 Dec 1997 00:00
survival_guide
Author: Carolyn Beckman
Date: Wed, 31 Dec 1997 00:00
Date: Wed, 31 Dec 1997 00:00
1003 lines
48359 bytes
48359 bytes
The Biologist's Survival Guide to Some Computer Somewhere
Alcor-Clone Edition
This introduction will not teach you all about Unix.
It is designed to give you a quick start so that you know enough
to manage your account and move around the internet well enough
to find the material that you need. It was originally designed to help
students in biology 461. It assumes that you know nothing about
multiuser computers at all.
It will be very useful for professional biologists to understand unix
in the future. It is the operating system of choice for computers which
store gene sequences and protein data bases, and it is also the operating
system that is used for machines that do molecular modeling and those
which analyze gene data. It is hoped that you will be interested enough
to explore the operating system and perhaps you will invest in one of the
many books that are available on the subject. As for those of you
who are undergraduates or graduate students, the fact that you have
had some experience with a unix computer looks nice on your resume and
it may help you in your career.
Note that the undergraduate is short of time during the semester.
This usually results in a situation where what is learned becomes what
the student is forced to learn. It is important for you to learn a little
about unix commands. Simply learning to use the menushell provided on
alcor is not enough. The next unix or unix-like computer will not have
a menushell. If you are taking biology 461, you are required to read and
learn the material in this survival_guide. You will be examined on it,
and you will be required to know how to work from the tcsh prompt.
Carolyn Beckman
beckman@clone.concordia.ca
1. Getting There- The access road to the the Information Highway.
Your account is on some computer somewhere. It is probable that
you will never see the computer that it is on. It is at Concordia,
but even that is not necessary. It would work just as well if
it were in California. All that is important is that you have an
account and some means of getting to the computer. This involves
applying at the the services window on the ninth floor of the hall
building and picking up the account card when it is ready.
The material in this document applies to alcor. Alcor is different
in that the user starts with a menu. The different methods of
dealing with that will be noted. The authors opinion is that the
best method is to change to a shell, such as tcsh, however the menus
are possibly useful for those who wish to be functional immediately,
without learning much about the operating system. Note that you can
always change to menushell with the command menushell. Menushell is
inadequate for the experienced user, and hinders the learning of
commands that are common to any unix computer. If your account is
configured for menushell you can use tcsh with the command !tcsh.
This writeup assumes that you use tcsh.
How to get there.
Some of you may be biology 490 students.
1. If you have access to any networked computer in the biology
department you may use that.
Commands:
NCSA
telnet "computer name" (Do not use the quotes)
login at the login prompt.
Example: We shall go to our library.
NCSA
telnet mercury
login clues
2. If you have a modem and a home computer you can access the
network from home. This document will not tell you how to
use your modem software. The number for MacDuf is 848-3270.
Another number is 848-8800. This facility is dromio. It has
slower modems. There is an express facility at the number 848-8820.
You are limited to 20 minutes of usage on the express lines.
You should use 8 bits, none and 1 for your modem software and
emulate a vt102 or even better a vt100. Once you are connected
you should use rlogin "machine name" to connect to the computer
that you want. MacDuf will connect with rlogin "computer name"
-l "user name". Do not use the quotes. In some cases you can
telnet to the computer that you want but uploading and downloading
of files may require the rlogin proceedure.
3. You can access your account from any other computer account
that you have by telnet or rlogin.
4. Certain other terminals at the school will work. There is
an X-terminal in room h1239 that you can use if you are a 490 student.
There is also a room full of terminals on the ninth floor
across from the computer services window at 927.
5. There is an internet lab. with networked macs in room 511 of the
hall building. To use these machines you must have an internet
account which is available to any undergraduate or graduate student
at Concordia.
2. Passwords and Login
Your account is protected by a password. Only you should
know this password. On networked computers the game among the
destructive is break and enter. You may think that you have nothing
to hide in your account, but soon you will accumulate files that
you would hate to lose. In addition if someone breaks into your
account they could participate in illegal activities for which you
might be blamed. Unix is case sensitive. You can use eight letters,
numbers or symbols in your password. You should not use words in
any language because there are programs which will try all the words
in a dictionary file to see if your password is one of them. You should
pick something that is known to you alone. One method of making a good
password is to think up a sentence. Example : I like to go gathering
nuts in May. Password = Il2ggniM You should not use any example that
anyone has given as a password. Do not use your name in any form, or
your user name. Do not use common obscene words. They are easy for
crackers to guess. First people want something that they can remember
easily and secondly people get frustrated with computers. There are
such things as password aging programs, which require you to change
your password after a certain time. Fortunately alcor does not use
this. It does require you to pick a password which is not based on
words, contains at least one symbol, a number and has upper and lower
case letters. Think up a good password before you login to the
computer.
3. Logging in
Here we go. The requirements are that you have accessed the
computer by one means or another, you have the account card that you
got from computing services and you are facing the login prompt.
You know that unix is case sensitive. Note that the card is written
in capital letters. Nah! Do not think in this particular instance. The
likely problem, is that you are dealing with a printer that only prints
capitals. Enter your user name in small letters and the password given on
the card in small letters.
If you succeed, you will be facing a prompt that is a percentage sign.
% or a >. On alcor you will be in the menushell. It is now time to
change your password. Enter the following command.
passwd (Enter !passwd on alcor)
You will be given instructions on what to do by the computer from
here on. Note that you will be required to enter your new password
twice. On some computers you may be required to change your password
the first time you log in. Some computers also require you to enter
your old password, (the password on the card).
You can leave your account by writing "logout".
4. Terminal Confusion and Killing
One of the pitfalls that the beginner must face is that there
are many kinds of computers on the internet and not all of them
use the same methods for displaying material on the screen.
The result is that very often the beginner finds themself facing
a screen that is frozen, and nothing will work. It is hoped that
these few words will help you with this situation.
There are two items to consider.
The first is your local computer. The second is the remote computer
that you are accessing.
Let us consider the local situation first.
NCSA telnet is set up as a vt100. (This is an old dec terminal and
the NCSA software has commands to emulate it.)
Most dos modems have a vt102 emulation.
A few have a vt100 emulation.
In general you must enter a command from your account that tells the
remote computer what kind of a terminal you are emulating.
In a C. shell you enter set term=vt100.
If you are using a dos modem with vt102 emulation the best you
can do is set term=xterm.
If your terminal freezes and you can log in by another machine you
can fix the problem by killing your frozen shell. Do this.
login from the other machine
ps -ef
Find the pid of your old C shell (pid = process identification number)
kill -9 1254 (note substitute the real number for 1254)
This is a brief summary of how to kill processes on a unix style
machine. The information and example of the process table are from
clone. Similar tactics should work on machines that have different
unix systems with possibly some minor modifications in the commands.
First of all there are situations in which you may find yourself
in a situation where the monitor screen does not respond to anything
you type. It appears frozen. The usual cause is terminal emulation
incompatibility. In your situation, setting your terminal as a vt100
will avoid most of these problems. No setting is necessary with NCSA
telnet.
Now, after you telnet to clone you should enter set term=vt100.
This is the equivalent unix style command and it will avoid most problems.
Accidents however do happen. In order to fix them we look at the process
table from clone. The command to get the following information is ps -aux
on clone. You can get similar information with ps -ef on alcor. Note
that alcor has enough processes running, so that it is useful to use
ps -ef |less. You can push the space bar to move forward with less. The
b key will take you back one screen at a time. Enter q to quit less.
The command ps will give you the processes that you are running on alcor.
USER PID %CPU %MEM SIZE RSS TTY STAT START TIME COMMAND
beckman 1950 6.1 3.3 396 508 pp0 S 10:14 0:02 -tcsh
beckman 1964 0.0 1.3 81 208 pp0 R 10:15 0:00 ps -aux
root 1 0.0 1.3 44 204 ? S Feb 6 0:08 init
root 6 0.0 0.8 24 124 ? S Feb 6 0:00 bdflush (daemon)
root 7 0.0 0.8 24 128 ? S Feb 6 0:01 update (bdflush)
root 18 0.0 1.3 56 212 ? S Feb 6 0:14 /usr/sbin/crond -l10
root 34 0.0 1.5 57 232 ? S Feb 6 0:06 /usr/sbin/syslogd
root 36 0.0 1.3 36 200 ? S Feb 6 0:00 /usr/sbin/klogd
root 38 0.0 1.4 68 220 ? S Feb 6 0:03 /usr/sbin/inetd
root 40 0.0 1.3 64 204 ? S Feb 6 0:00 /usr/sbin/lpd
root 45 0.0 2.6 251 396 ? S Feb 6 0:05 sendmail: accepting con
root 51 0.0 1.5 88 232 v02 S Feb 6 0:00 /sbin/getty tty2 38400
root 52 0.0 1.5 88 232 v03 S Feb 6 0:00 /sbin/getty tty3 38400
root 53 0.0 1.5 88 232 v04 S Feb 6 0:00 /sbin/getty tty4 38400
root 54 0.0 1.5 88 232 v05 S Feb 6 0:00 /sbin/getty tty5 38400
root 55 0.0 1.5 88 232 v06 S Feb 6 0:00 /sbin/getty tty6 38400
root 976 0.0 1.5 88 232 v01 S Feb 7 0:00 /sbin/getty tty1 38400
root 1949 0.6 1.5 46 232 ? S 10:14 0:00 in.rlogind
We are interested in a number of items here. First note the user. In
the first two instances the user is beckman. Beckman is running two
processes, the first tcsh and the second ps -aux. The first is the
shell that beckman is using to log in. It is a modified c shell that
you all use on clone. The second entry is the process for the command
that beckman ran to get the table. The other processes are owned by root.
You can not kill them. Only the processes that you own (You are the
user) can be killed by you. Right after the user name there is a
column that says PID. This is the process identification number.
Now let us try an example. Let us say that you log in from
somewhere and you try to use the editor pico. You get no response from
your keyboard. Log in again from another terminal but remember to set
it up with the vt100 commands. Now run ps -aux and find the PID of the
process owned by you that is running pico. You may have to use this
command if there are many people using the machine. ps -aux |less
Use the space bar to scroll down the screen. Enter this command.
kill 1324. You substitute the real process number that you have found
for 1324. This should kill the editor pico and unfreeze the screen.
Note that there is a last resort. You can kill your shell. This will
kill every process that you are running and log you out from the machine.
It is done in this fashion. kill -9 1324. In this case you substitute
the PID of your tcsh for 1324. Note that -9 is an unconditional kill.
That is even though there are other processes running that depend on the
existance of your shell, you kill the shell. That kills the other processes
too. It is better not to do an unconditional kill if you can get away
with just killing the process that froze your terminal.
5. HOME- Setting Up Housekeeping
ls
Enter the command ls. This is short for list. It is similar to
the dir command in dos. Note that you have no files.
It is not true that you have no files. There are certain files that
are executed when you log in. These files have a dot in front
of them that makes them invisible when you use the ls command. It
also makes them executable when you log in.
Enter the command ls -la to see them. Note that there is a space
between the ls and the -la. The option -l gives you the long form
of the file. If you had any visible files ls -l would show you the
long form. We are going to deal with a certain file named .cshrc
First of all you are working with a C-shell. In a sense the shell
in unix is similar to a command.com in dos. That is, it interprets
certain commands for you. It could be replaced by a different shell,
or it can be configured to act differently. The .cshrc (C-shell run
commands) does this for you. We are going to replace your .cshrc
with one specifically designed for this course. In the process you
will learn file transfer protocol.(ftp) This set of commands transfers
files from one computer to another. You can use it to get many
files on the internet.
Note that a sample .cshrc follows the section on ftp. Biology
461 students should ftp the .cshrc from clone. Others on alcor
should read the material on ftp for enlightenment and alter
their .cshrc as the need arises. Your .cshrc can be edited with
pico. The command is "pico .cshrc". Do not use the quotes.
Enter the following commands. For the purposes of the exercise
we assume that your user name is "user" Possibly we both hope it is not.
ftp clone (clone is the name of the computer you are going to. In
this case it is a concordia computer so all you have to
enter is its host name. If you were going to a computer
outside you would have to enter a domain name.
Example ftp oak.oakland.edu will get you a large software
archive. Oakland.edu is the domain name.)
Note that clone is a small computer and only supports only a few ftp users
at a time. You may be refused and have to wait if someone else is
ftping the file.
login anonymous
password user@
cd pub/clone-alcor
dir
get 461.cshrc
bye
You should be back in your directory. Now if you say ls -l
you should see 461.cshrc. We are going to replace your original
.cshrc with 461.cshrc. The command is mv (move)
mv .cshrc old.cshrc. (Do not bother with this at clone. You have no .cshrc)
mv 461.cshrc .cshrc
We will now put your new .cshrc into action.
source .cshrc
You should see a configured prompt that tells you that you are in
your home directory. Now let us talk a bit about ftp. The computer
clone contains a number of sub directories in the directory pub. One
of the others contains a login.com for the vax2. Another contains
files for dos computers. They are compressed and must be transfered
in the binary mode. They are a recent version of f-prot, a good
virus prevention program that is free to individuals and a recent
version of pk-zip, the compression program for the f-prot. The pk-zip
is shareware. You are allowed to try it out but if you continue to use
it you should register it. If you have a dos computer, feel free to
take these files. The easy way is from a networked dos computer in
the biology department.
ftp clone
login anonymous
password user@
cd pub/dos
binary
get "filename" (no quotes)
bye
Now copy the files to a floppy disk and take them home. Note that
this introduction will not tell you how to work with your dos computer.
We are interested only in the use of ftp.
These are other useful commands.
put This puts files that are on your local computer to the remote
computer. Note that get did the opposite.
mget * This will get all the files in a directory.
On many computers you can read small ascii files in this fashion.
get "filename" |more Note that there are two kinds of files that
you should be familiar with. Ascii files are files that you can
read. Binary files are files that your computer can read.
Besides transfering files by anonymous ftp you can also transfer
files to your account from another computer where you have an account.
Your root directory will get very cluttered if you put everything
in it. It is a good policy to keep files for configuration purposes
in the root directory and make subdirectories for other files.
We will make a subdirectory.
mkdir docs
now we will change to it.
cd docs
we will list the files.
ls -la
Note that there are two files. One is called . That means this directory.
The other .. is the directory above. That is your home directory.
Change to it with cd .. and now change back with cd docs.
We are going to make a file. Enter this command.
pico testfile
Now write whatever you wish to write and then exit with the
control x at the bottom of the screen. Follow the instructions
given for writing it. Read it now.
cat testfile
You could alter your .cshrc with pico. The command is pico .cshrc.
If you have a .cshrc pico will allow you to edit it. If you have
none, then pico will create a file named .cshrc and you can write
what ever you need. Let us look at a .cshrc and see some of the
things that could be there.
______________________cut here___________________________________
# *** A .cshrc file for alcor ***
umask 077 # new file mode=600=-rw-------
set history=50 # save last 50 commands
set savehist=50 # how much history to keep across logins
set noclobber # confirm file overwrite
set nonomatch # expand filename subst. pattern
#set ignoreeof # cannot log out with ^D
set notify # async. report on background job status
set filec # file completion (hit 1st letter + ESC)
# *** command search path: ***
set path=(/usr/ucb /bin /usr/bin /usr/hosts)
set path=($path `/local/bin/local_path -csh` . ~ ~/bin)
setenv NNTPSERVER newsflash.concordia.ca #defines newserver
# *** where system-supplied aliases are located: ***
#source /local/etc/prodef/aliases #if uncommented allows use of certain
# system wide aliases in the file
# mentioned.
# *** aliases ***
alias bio tin -r bionet.molbio.genbank.updates #uses newsreader tin
# to access a certain
#newsgroup
alias oak ftp oak.oakland.edu # Big mirror archive
alias gomeg gopher megasun.bch.umontreal.ca #good biochemical gopher
alias yahoo lynx http://www.yahoo.com #starting place for lots
# of sites
alias kan lynx http://www.cc.ukans.edu # the original lynx site
alias dir ls -al #allows dir to be used
#for ls -al
# *** startup ***
# This entry sets the hostname in the prompt and also the
#current directory. In addition it defines the number of
#rows and cols. Note that the if, then and endif are not
#necessary unless printing from a remote location is set up
# with rsh and rcp.
#set term=vt100
if ($?prompt) then
set prompt=`hostname`":"$cwd" > "
alias cd 'cd \!*; set prompt=`hostname`":"$cwd" > " '
stty rows 24 cols 80
endif
# *** IRC ***
#setenv TERM vt100
setenv IRCNICK "put nickname here"
setenv IRCNAME "put name here"
____________________________cut here______________________________
There is one more thing you should do to your home directory. You
should make it impossible for others to use it. To do this we use
a command called change mode. (chmod) We must look at some file
listings and understand them to do this.
Here are some examples:
drwxr-xr-x 2 beckman wheel 1024 Oct 26 22:37 ./
drwx--x--x 17 beckman wheel 2048 Oct 26 22:29 ../
-rw-r--r-- 1 beckman wheel 541 Oct 19 15:49 ch0
The command to produce a listing of the examples to the screen
would be ls -la. The three files are named ., .., and ch0.
The first item that we will look at is the series of letters that
start the description of the file. These are the file permissions.
The letter d indicates that the file is a directory. A regular file
just has a blank at the start. The next nine letters or spaces indicate
what 3 sorts of users are allowed to do with this file. The sorts of
users are the user who owns the file, the members of the group and finally
others. The first three letters after the d in the first entry
indicate that the user who owns the file can read (r), write (w),
and execute (x) files in the directory. In contrast the members
of the group can only read and execute files in the directory and
others can only read files in the directory. The owner of the file
in question is beckman, and the group that beckman belongs to is wheel.
Not all versions of unix will show the group with ls -la. Berkeley
versions show the group with the command ls -lag. Note that the name
of the file which is found at the end of the line is ./. The symbol
. (dot) means this directory. We now get to the point of this
explanation. You do not want other people to be able to write files
to your home directory on a public computer, and in many cases you do not
want them to execute your files or even read them. Permissions can
be changed if you are the user who owns the file. Enter this command
to keep everyone else from writing to your directory. "chmod go-w ."
Do not enter the quotes. Similarly, "chmod go-r . " would keep
everyone but you and root from reading your files. You might wish
to allow other members of your group (this class) to read your files
on clone. Since all undergraduates are in the same group on alcor,
you may not want to let them read your files. It is an individual
decision. Note that a readable file in an unreadable directory is
still readable if you know the name of the file. The only difficulty
is that you can not read the directory to find the name of the file.
If you entered "chmod ugo-w ." you would be in trouble because you could
not write files to your home directory.
6. Moving Around
On a unix computer, you can move around from directory to directory and
look at how it is organized. This is more than idle recreation. It
will eventually give you some sort of a mental picture of where various
things are. Of course this is artificial and has little to do where
the information is physically on the hard disks, but it is handy because
it will help you know where to look for useful goodies that the system
administrator may have installed.
First of all there is a path in your .cshrc. You may execute the commands
in your path by using the name of the command.
example:
The command cat is in your path. We will now look at the message that
you saw when you logged in. It is called the message of the day (motd)and
it is found in the /etc directory. Note that the / means root and it
is in the opposite direction from the dos slash \. To look at it we
enter the command cat /etc/motd. If it is long perhaps we can not read
all of it with cat. In that case we can say less /etc/motd. Space to
move down a page. You can get out of less with q. Where is cat? Enter this
command to find out.
which cat
If the path for a command that you wish to use is not in your path, you
can execute that path by putting in the absolute path. Ping is a command
which is usually not in average user's path. What it does is see if
another computer is functioning. Enter the following command.
ping clone
Your should get a message that indicates that ping is not in your path.
Note: Ping is not in /etc on clone. It is in your path.
Perhaps it will say, ping not found, or something that means the same.
Now enter this:
/sbin/ping clone
Note that ping is in /sbin on alcor. On clone it is in bin .
You should see the message indicating that clone is alive or on some
computers you see a listing of the packets that are being sent to see
if clone is alive. You must stop this with control c.
The command /sbin/ping shows absolute addressing. That is all the
directories starting with the root and all those afterwards must be
listed before the command.
We will now talk about how to change directories.
1. If you wish to go to the parent directory of the one that you
have entered cd .. Try this. Go to home.
2. If you wish to enter the directory below the one you are in
enter just the name of the directory. In your case to return to
your home directory you could enter cd .
3. To go directly to any other directory enter the absolute address.
For example, to go to /local/bin you must enter cd /local/bin.
7. Finding Information about Commands
Unix computers have a manual which contains information on how to
use commands that you are likely to want to know how to use. The
formula for finding this information is "man name" where name is the
name of the command that you want to know about. The man is much more
useful than VMS help files but there are a couple of catches involved.
First you have to know the name of the command that you want to use.
The second is that some man pages are well written, while others seem to
be specifically designed to irritate the beginning user. There is not much one
can do about the second problem except recommend any book that explains
some of the basics. For the first problem, we can furnish a brief
description of some of the commands that you are likely to use.
cat concatenate -displays, writes or adds to files.
chdir change directory
chmod change mode-changes permissions on files
cp copy
find finds files
grep finds specific lines of text in files.
ln links files
ls lists files in a directory
mkdir makes a directory
more- allows you to examine a file screenful by screenful
less- a better more
mv move change a file name
passwd change your password
pico a small editor
pine an e-mail utility that uses pico
ps -aux look at the process table (a list of what everyone is doing)
Use ps -aux on clone. Use ps -ef on alcor
pwd prints the name of the current directory
rm remove-remove a file
rmdir remove a directory
vi a complicated editor with many commands
If you want to know how to do something, and you have no idea of the
command you can enter "apropos print" for example. This will give
you a list of all the commands that have something to do with printing.
You can explore them until you find the one you want. You could also
enter man -k print, which does the same thing.
8. Pico and Pine
The editor that you can use to write small files is pico. It is
used in this fashion. pico filename. The commands that pico uses
are listed at the bottom of the screen. You can use pico to write
or add material to a file.
Pine is a mail utility that uses the editor pico. My address is
beckman@clone For users of VMS please note that there is no IN
and or quotes. The command to use pine is pine. Follow
the instructions from there. They are easy. Your assignment if you
are a biology 461 student is to send me mail. If you are not a
biology 461 student send mail to someone for practice just to
see if you can do it. Note that the address is read, beckman at
clone. You have a user name on your card. Your address is
username@clone or username@alcor.
You can write yourself a signature file which will be automatically
sent with your mail. It should have your name and your mail address.
A typical signature file is given as an example below.
=====================================================================
beckman@clone.concordia.ca
Carolyn Beckman
=====================================================================
Note that the.concordia.ca is the domain name. It is necessary for
people to have that if they send you mail from outside concordia.
The host name is clone.
To write your signature file do the following.
pico .signature
Write what ever you wish to write and save the file. The name .signature
is necessary if you wish pine to add the file automatically to your
message.
Many people add other information to their signature files such as phone
numbers, sayings and ascii art. It is considered to be in bad taste if
you add too much nonessential information such as a whole screen of ascii
art. It just clutters up the recipients screen.
9. Redirection
Normally what ever it is that you write appears on the screen. Many
books confuse the issue by telling you that you are writing is directed
to standard output when you have no idea what that means. Normally,
If you type something with your keyboard, you will see it on the screen.
Now let us redirect what you type into a file.
First enter this command. This tells the utility cat to redirect
the output from your screen to a file called garbage1.
cat > garbage1
Write whatever you want to write in this file. Note that at the
end of a line you must push the enter key for a newline and that
once you have done this you can not go back and correct a line.
This is a method of making a file but it is not as convenient as
the editor pico because lines that are written can not be corrected.
Now write your file with control d. Look at it with:
cat garbage1
Let us add some material to the file.
cat >> garbage1
Write:
This is an addition to garbage1.
Now write your file with control d and look at it with:
cat garbage1
Cat is an abbreviation for concatenate. The definition is:
"join two files together".
Make the file garbage2.
cat > garbage2
Write something and use control d to write your file.
Now do this.
cat garbage1 garbage2 > garbage.can
cat garbage.can
Other files can be redirected. For instance all unix systems have
a mail utility which can be used to send files. Try this with a
friend with an account.
mail username@clone < garbage.can
Your friend should receive the file garbage.can.
10. Gopher
Please note that gopher services are gradually being replaced by
web servers in many cases. The examples given here may cease to work.
Gopher is a utility that helps you get files from other
computers easily. There are computers that offer files. These
have gopher servers. There are also computers that receive
files. These computers have gopher clients.
Your computer has a gopher client. Enter the command:
gomeg. This will take you to megagopher at the University of Montreal.
It is an alias in your .cshrc.
Note the arrow. What you do is put it on the catagory you want and
enter.
What gopher does for you is make the details of telneting, and ftp
automatic.
All gopher servers are connected and by following the arrows
and by experimenting it is possible to get from one to the other.
At times however it is more profitable to start at a convenient
gopher that has a lot of material about your subject.
11. Lynx
Lynx is a text based browser for WWW. WWW stands for world
wide web, a system that combines gopher sites, ftp, hytelnet and information
from internet news. All documents can be accessed and saved. You
can not see images with lynx. If you have the terminal
capabilities to run graphics, you can use Ncsa Mosaic or Netscape. Both
require Xwindows with unix or linux.
Enter the command, "lynx". The best way to learn to use lynx
is to explore the possiblities. One thing that you can do is go
directly to a site from the command line just as you did with gopher.
A useful site for you is: http://www.yahoo.com.
It has been aliased as yahoo in your .cshrc.
A convenient starting point for biologists is this.
Enter "lynx http://clone.concordia.ca/home/home.html"
This will take you to the clone home page. From here it is easy to
consult OMIM by lynx. If you are taking biology 461 you are required
to consult OMIN. You could put an alias for this site in your .cshrc.
12. Printing
On clone the command for printing is lpr "filename" Note that you can
only print text files that you have obtained from the internet. The
printer is an ordinary dot matrix printer. Never try to print binary
files.
The printing command for alcor is also lpr for ordinary text files.
In addition you must specify the printer that you are going to use.
The information on printers is found in /etc/printcap.
lpr -P lp1 "filename" should print the file on the 9th floor of the
hall building at printronix printer 1.
After you print your file you should delete it from your account. You
have 2.5 meg of disk space. This is adequate for your needs, but only
if you do not save files that you do not need. The command du will give
you the amount of disk space that you have used in your quota if you
enter it from your home directory.
13 Survival techniques with vi
The editor vi has over 200 useful commands. This is rather
frightening to the beginner, however sooner of later you will meet
vi, simply because it is the editor that is on every unix system and
it is one of the most versatile editors. If you wish to post to news
from tin the editor that you will use will be vi. You do not have to
know 200 commands to use this editor. A few will do the job.
One of the major problems with vi is that of terminal compatability.
If anything is wrong, vi will show it and horrible things will seem to
happen to the file that you are trying to alter. First of all, relax.
No matter what seems to happen to your file on the screen, you have not
altered it until you write it, and you do not have to write it. Let us
start with an explanation. Vi, when it is started, puts the file in a
buffer. A buffer is a special area of memory. The file on the disk is
not altered unless you tell vi to do that. (Note that the same is true
with pico and with most other editors.) To bail out without writing the
file you have to know this. Press the escape key twice. The second time
it should beep. Now enter :q! This will get you out of vi without writing
your file.
To continue, you must know about two modes in vi. One is the
command mode. To write a command such as we just did. :q! First push the
escape key twice. It should beep. The second beep is really an error
message telling you that you are already in command mode, but since not
all versions of vi can be set to tell you that you are in command mode,
the error message can be used.
The other mode is called insert mode. In this mode you can
write to the screen. When you start vi without a file, there are a
number of squiggles on the the screen The correct name is cedilla.
There are no lines in the buffer. You can put a line in the buffer
with the o key. The o key will put a line in after the cursor. The
O will put the line in above the cursor. Alternatively, you may push
the i key. This will allow you to insert text starting with the
space before the cursor. If you make a mistake back up with the arrow
keys and write your correction over your error. Alternately you can
go to command mode and put the cursor on a letter that you wish to
delete. Then you type x. You must return to insert mode after this to
write more material You can also insert material after the cursor.
Push the a key to do this. In command mode the d key followed by w will
delete the word your cursor is on. Similarly dd will delete a whole line. 50dd will
delete 50 lines after your cursor.
To write your file push the escape key twice and write :wq. Note that
if you start vi without a file name you must name your file to write
it.
Push escape twice.
enter :w filename.
Now you can quit with q!
This is really all you need to know to function with this editor
however there are many useful things that you could learn to be more
effective.
Let us look at a few of them. First we will start vi, write some
material and then add a file to it. You need a file. The garbage.can
file that you wrote previously will do.
vi mynufile
i Then write the material
push escape twice.
You are in command mode. Enter :r garbage.can
Write your file with :wq
You can set various options with vi. For instance
:set number
This will number the lines in your buffer. It does not put numbers
on the file that you write to the disk.
:set tabstop=4 will give you tabs of 4 spaces.
Both alcor and clone have vim in addition to vi. Vim is like vi,
but it is easier to use. For instance you can erase material on
the same line with the backspace.
14. Setting up tin.
On alcor or clone you can do this very easily. Enter the command "tin".
You will get a default .newsrc which has been set up to subscribe you
to a small number of groups. You can add to this by pushing the y
key. This will add all the groups that you are not subscribed to.
Now you can subscribe to a group with s. When you have finished you
can push the y again. This will show only the groups that you are
subscribed to.
More extreme measures may be necessary if you are dealing with a
news server that does not write a .newsrc by default.
EXTREME MEASURES YOU DO NOT NEED TO USE AT CONCORDIA
CAUTION Do not do this unless your term is vt100 Use ncsa telnet to
get to your computer. After login enter echo $term if it is not vt100 ,
enter set term=vt100
Enter tin. Then quit with the Q. What this will do for
you is write a complete .newsrc which contains all the groups,
and you will be subscribed to all of them. There are several
thousand.
vi .newsrc
push escape twice. It should beep.
Write :%s/:/!/ at the bottom of the screen. It should go there if
you have followed the first instructions about the esc key.
Enter The command replaces : with !. You are unsubscribed to all groups.
Now enter tin and push the y. This will show you all the groups.
Subscribe to those that you want, and then push the y to show only
the subscribed groups.
For those who wish to play more with vi, the following method is
available.
scroll through the file with the cursor keys.
find a group that you like and replace ! with :
Do it like this.
push esc
place the cursor on ! then type x
type i then type :
to write your file and quit
push escape twice. beep beep
write :wq
enter
Most likely, you should subscribe to concordia.announce and concordia.test.
Note that there are at least 50 groups of biological interest.
Now slrn is available at alcor as the default newsreader. It is
easy to use, and not as old as the version of tin. Just type slrn
at the prompt.
15. X (X windows)
Xwindows is a graphical environment that many unix
systems have. There is an X terminals in room H1239. These
terminals will allow you to log into your account, and use
netscape instead of lynx. The advantage of netscape is that you
can see the graphic information. The disadvantage is that X
applications are slower.
Note that X consists of two sorts of items. The first
is an X-server. This consists of a crosshatched screen with an
X in the middle. You will see it briefly when you log in. The second
sort of item is an X client. There are many. These are
applications which can be displayed on the server. Netscape is an
application. So is xterm. In theory, any X application from
any computer can be displayed on any X-server. This makes it
possible to log into two or more computers at once and run applications
on all of them, and display them on the same monitor. Since it
is likely that you only have one account that supports X, it is
not a possibility that you need to explore at the present time.
To log into a computer from the X terminals in
H1239, first find it. Note that you are only eligible to use it if
you are a 490 student. It is locked in the cage.
Note that the screen blanks when these terminals are not in use
for a while. To get rid of the screen saver push any key. Now
put the mouse arrow on the hostname of your computer and click the
left mouse button. Move the mouse arrow to accept and click the left button
again. Now log in as usual. Note that you have a window with your
hostname in the top corner and also a clock and a mailbox. Put the
mouse pointer in the window. Note that the cursor, which is a block
changes when you do that. That means that the particular window is ready
to accept a command. Enter xterm in the window. Note that now you
have an outline with a grid on it. Move this grid to about the center
of the screen by moving the mouse. Now click the left mouse button
again and you have an xterm. The xterm is a new shell and in your case
since you are using a c shell it is a C shell that will use all the
commands in your .cshrc. Enter the command who |less. Enter it in the
xterm window. You will see that you are logged in twice. One login is
the original login that you did to get to your host computer. The other one
is the xterm that you have just created. Note that xterm is like a vt102
terminal.(There are more graphic goodies.) At the beginning of this
document you were told to use xterm if you had a modem that emulated a
vt102 terminal.
Changing the size of your xterm
You can change the size of the window in your xterm in the
following way. Put the cursor on the upper right hand corner of the
window. Drag the cursor in the direction that you want. This may
feel awkward. If you click on the left mouse button and choose resize,
you can resize the window from any corner.
Scrolling through a directory.
There is a double band on the left side of your xterm window.
For cd to a directory where there are many files. A good choice is
cd bin. Enter the command ls -la. Note that you are at the bottom of
the file listing. Put the mouse button on the scroll bar. Clicking
the right mouse button will move you up. Clicking the left button
will move you down.
Starting Mosaic.
Enter Netscape & in your xterm. Again you will see a grid. Put it
where you want it on the screen and click the left button to start it.
Leaving X. Log out with the window manager.
Note! Note! Note! You are working in a public room. You should never
leave your terminal while you are logged into your account. If you
do this anyone can use your account. Your 2.5 meg of diskspace is
a valuable resource.
16. Controlling the h
If you rlogin or telnet from one unix computer to another,
you may find that the backspace key that you hope will erase a
typing mistake causes a control h to appear on the screen. The
symbol for the control character is found above the 6 on the
keyboard. Really, the symbol does indicate that the erasure
was made. What you can do to make your screen more readable is
this. Enter the command stty control-h. To get the character,
you press the backspace. What this will do is eliminate the
appearance of the control-h character on your screen and backspacing
will be normal. On some computers you will see the symbol control-?,
instead. In this case enter stty control-?. Again the control-?
is made by pressing the backspace.
17. Converting Ascii Files
There are differences in the ends of lines in dos and unix ascii
files. This requires some method of converting the files so that
they can be displayed and printed correctly.
Dos files lines end with control-M control-J, while unix files end with
control-J. If you look at a dos ascii file in unix you will see the
control-M. Control-M is the carriage return and control-J is the line
feed. In order to display a dos ascii file in unix correctly you must
remove the control_M. There are a number of ways to do this. One
convenient method is to make a small shell script with the contents,
#/bin/sh
cat $1 tr -d '\015' >$2
The file might have a descriptive name such as dos2unix and of course
it must be executable. It is used in this fashion. Dos2unix garbage.dos
garbage.unix You substitute the real file name for garbage.dos and
make up the name for garbage.unix. What the file does is delete the
octal number 15 which is control-M Such a file exists in the /home/
beckman/pub directory. Since you have access to this directory you
can use it as long as you use the absolute path to address it. You
could also copy it to your directory if you like, or put the entire
directory which contains it in your path.
The reverse case is this.
You ftp a textfile to a dos machine from a unix machine and then discover
that it is one mass of continuous text rather than having distinct lines.
Load your file into edit in dos. The microsoft editor will add the missing
character control-M. Then you can display and print it normally.
Ascii Conversions, Mac to Unix, Unix to Mac
In mac ascii files the line ends with octal 12 which is
control-M. In unix files the line end character is octal 15 which
is control-J. Hence the appropriate character should be substituted.
One method of doing this follows.
Mac to unix, tr '\015' '\012' < mac.filename > unix.filename
The reverse also works.
Unix to mac tr '\012' '\015' < unix.filename > mac.filename
In addition on many unix computers tools are available for
dealing with specialized mac files that can be obtained from sites
on the internet.
For instance, clone has macutils. For information try, man macutils.
Alcor and clone have mcvert. See man mcvert.
--
=================================================================
beckman@clone.concordia.ca
Carolyn Beckman
=================================================================
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads