INSTRUCTIONS
for CONNECTING to MAIN FRAME and
USING
UNIX COMMANDS and EMACS
( Jacob Y. Kazakia September 2008)
1.
Install the program X-Win32 9.2 to your computer.
2.
From Start, from
Programs, from X-Win32 9.2 select X-win32 .
A window will appear in the middle of the screen for a
short while and then it will disappear.
After this point you should see in the right hand side of the program bar of
your screen an icon of X.
Click on it and a selection of connections will appear. See below:
3.
Select leaf.cc.lehigh.edu The following will appear:
4. Enter your user ID
and click continue. The following will appear
5. Enter your password and click continue. The following will appear:
PLEASE NOTE: below
this point the material refers to our earlier main frame vega. However
the unix commands are
exactly the same as the current ones.
You can move to your AFS space by changing
the directory . This is the first command
entered in the figure below. Notice that the prompt changes to indicate the new
location. The second command is ls and it
lists the directories & files in my AFS space. A more detailed listing is
obtained by the third command entered ls -l . At this point, you don't have a subdirectory named
engr1 as I do. But you should have a subdirectory named private and one
named public. You can tell the subdirectories by the fact that their
detailed description starts with d . For
example, in the figure below Desktop is a directory and so is News but Power.dt is only a file. The string of characters next to d
determines the permissions given to the file/directories (don't worry about
them now). The rest is sort of self explanatory.
Now let's
make a new directory named jyk0demo and let's use emacs
to write a simple file named jyk0ex1.txt in this directory. The
necessary commands are shown below together with the picture of the editor emacs which pops up as a result of our command. Note that the & entered after the file name in the command emacs jyk0ex1.txt is used in order to keep both the xterm window and the editor window active.
Here is
the Emacs window :
Notice
that the name of the file appears on the black line towards the lower portion
of the editor. The menu on the top is very similar to PC windows applications
and the editor is mouse controlled. The response of the system is significantly
slower that the windows environment; don't be annoyed take longer breaths. We
type the contents of a simple file as shown:
Clicking
on the Files part of the menu generates the following figure.
Selecting
Save (current buffer) will save the file in the
current directory. Clicking on Exit Emacs will
terminate the session etc.
Now
let's look at the xterm window (
notice that you get a message at the command line of the editor when the
file is saved (written):
Note that
the file is now in the jyk0demo subdirectory. Now suppose that we would like to
change the name of the file to jyk0example.cpp we can do this by either
cp ( for copy) command or by mv
( for move) command. We illustrate both of these below. We use cp for
jyk0example1 and mv for jyk0example2.
Note that
cp made a second copy of the file and it has a new different time stamp of
As
another illustration let's try to make a copy of the file jyk0example1.cpp in
the parent directory of jyk0demo ( which is of course,
/home/jyk0/AFS ) using the same name for the file. This can be achieved in various
ways as listed below:
cp
/home/jyk0/AFS/jyk0demo/jyk0example1.cpp /home/jyk0/AFS/jyk0example1.cpp
or
cp jyk0example1.cpp
/home/jyk0/AFS/jyk0example1.cpp (since the current
directory is /home/jyk0/jAFS/yk0demo )
or
cp jyk0example1.cpp
/home/jyk0/AFS ( since the file name will
remain the same)
or
cp
jyk0example1.cpp ..
(since
two periods denote parent directory)
The third method is illustrated below together with
the use of ls to view the file names and the use or rm ( for remove) to
delete the newly copied file.
cp /home/jyk0/AFS/jyk0demo/jyk0example1.cpp /home/jyk0/AFS/jyk0example1.cpp
or
cp /home/jyk0/AFS/jyk0demo/jyk0example1.cpp jyk0example1.cpp (since the current
directory is /home/jyk0 /AFS)
or
cp /home/jyk0/AFS/jyk0demo/jyk0example1.cpp . (since the file name is the same )
PLEASE
NOTE THE PURPLE SINGE PERIOD
or
cp jyk0demo/jyk0example1.cpp . (since jyk0demo is a subdirectory of the current directory)
PLEASE
NOTE THE PURPLE SINGE PERIOD
The third
way is illustrated in the figure below:
If you
need to examine the contents of a file, you can open it in an editor (or
application). A text file can also be viewed by simply using the unix command more followed by the
file name. This is illustrated below:
Press the
Enter key or the space bar to go to the next page.
Play
around with some more unix
commands. You can exit emacs from the menu Files. You
can exit the xterm (and terminate connection) by
typing the unix command exit.
You can close the toolbox window on your desktop.