Sooner or later you'll need to use Unix to run advanced programs. The favorite editor to use in conjunction with Unix is Emacs, so you should get familiar with Emacs basics too.
If you already know how to use Unix and Emacs then you don't need to do this assignment. Be sure you do know all the information covered here, however.
For the work in this course the following method of accessing Unix
should work fine. On an NT machine, access the SecureCRT program at
You'll get some dialog boxes the first time you run this. Go ahead
and make it your default telnet application in the first dialog box, and
select Accept & Save in the second box. After this first time you won't have
to repeat all these commands.
Once you're past all the dialog boxes, you'll get a prompt TERM =
(xterm). Just hit Return when you see this. Now you're logged into a
unix machine (called info.sims).
This is a very nice version of telnet. You'll notice the command menu
at the top allows you to do cut and paste, change the keyboard mapping,
and many other things.
Now do
the following operations (after each task I show the appropriate unix
command in italics).
Getting Started
There several ways to access Unix machines in the SIMS environment.
(We will be using Solaris Unix, because that is the Unix that runs on the
Sun machines that we use in the lab. FYI, Linux is
an increasingly popular form of Unix and we might have this in the lab in
future. The differences between these are supposed to be unnoticable, so
you don't really need to worry about this.)
Start\Programs\Internet\SSH-Telnet\SSH-info.sims
(You shouldn't use irony.sims for this assignment, as it is used for
other purposes. This is the secure version of telnet we're supposed
to use now. It encrypts your password over the network for you.)
Learn Unix
Read the information on Basic UNIX File Manipulation at
http://socrates.berkeley.edu/Help/Unix/basicunix.html
Now read the
information on UNIX Man Pages at
http://socrates.berkeley.edu/Help/Unix/manpage.html
Then read the Unix tutorial at http://riceinfo.rice.edu/Computer/Documents/Unix/UNIX1/unix1.html
This goes into more detail than the earlier tutorial and will repeat some of what you've just learned, but should make everything make fit together better.
Be sure to learn the parts about:
If you'd like more references, there is a list of recommended Unix guides at http://wss-www.berkeley.edu/unix/faq/books.html
Emacs makes extensive use of the Control key, which can take getting
used to. Something written as C-x C-c means first hold down the
control key and press x (while still holding down the control key) and
then do the same thing with control and c. (You can keep the control
key held down for both the x and the c.)
You can run emacs from the Unix prompt by simply typing Emacs.
This puts you in a buffer called *scratch*, which is temporary scratch space.
You save a buffer's contents into a file by typing C-x C-s.
The Meta key (usage is written M-x, for example) is either the Alt key
or the ESC key; you'll have to test it out on your system.
First read an emacs tutorial, for example
http://yoda.cis.temple.edu:8080/UGAIWWW/help/emacs-tutorial.html
Now use tutorial materials prepared by Armando Fox.
Go back to the unix prompt and do the following commands.
You probably want to create a customized startup file for emacs. You save
this information in a file called .emacs in your home directory.
You can store macros in this file and tell the system what mode to start
up in by default. Here are some lines from my startup file along with
notes as to why they are there
Here is one emacs reference guide. Learn Emacs
Now learn some basics about the emacs editor. Emacs has a huge range of
functionality but you only need to know the basics to get started.
(Its name stands for Easy Macros.)
You can get out of emacs by typing C-x C-c.
Undo the previous command with C-x u
(This means hold down control and x at the same time, then release
the control key and hit the u.)
Especially Useful Emacs Commands
Below I list what I consider to be especially useful emacs commands, omitting
emacs macros, which get their own section, below.
Emacs Macros
There are some aspects of Emacs that make it especially useful and worthwhile
learning. Probably the most powerful is the ability to write macros
on-the-fly to do repetitive editing work for you.
The main idea is that you can ``capture'' a sequence of emacs commands
and have the system repeat this sequence over and over again for you.
Here's how it works.
Emacs Initialization File
(setq inhibit-startup-message t)
(setq auto-fill-mode t)
(setq make-backup-files nil)
(global-set-key "\C-x\C-g" 'goto-line)
Now when I type C-x C-g the system asks me what line number to go to
and then goes there.
(setq auto-mode-alist
'(("\\.c$" . c-mode) ("\\.lisp$" . lisp-mode)
("\\.java$" . java-mode)
("\\.cl$" . lisp-mode) ("\\.html$" . c-mode)
("\\.tcl$" . tcl-mode) ("\\.tex$"
. latex-mode)))
Here is another quick reference guide to emacs
commands.
Last modified Sept. 30, 1998. MAH