CS 245
Sept. 16, 2002
black.goucher.edu
) and User Name information requested for the
dialog box which pops up. Click the Connect button and then enter
your password into the next dialog box.
Unix is case sensitive --- be careful when entering username and password!
A brief bit of documentation on SSH Secure Shell is available
here
(http://phoenix.goucher.edu/~kelliher/SSH/
).
In particular, you can download a copy of the software for educational
use.
>(or something similar). You type a command and then press
Enter
to
run it. You can edit a command before you run it by using the arrow keys
to navigate the command line.
cp ~kelliher/pub/.emacs .
/usr/local/bin/emacs .cshrc(You are in your home directory when you first login).
Find the line which contains:
(/bin /usr/bin /usr/ucb /etc .)and edit it so that it appears like this:
(/usr/local/bin /bin /usr/bin /usr/ucb /etc)Add these lines to the end of the file:
umask 077 set prompt="%m:%~\ %% " alias . logout alias ? apropos alias cp cp -i alias grep grep -i alias h history 25 alias ls ls -F alias ll ls -l alias mv mv -i alias rm rm -iSave the file (type
C-x C-s
) and find your .login
file (type
C-x C-f .login
). Add these lines to the end of the file:
setenv BLOCKSIZE 1K setenv LESS "-ceiMswx3" setenv PAGER less setenv PRINTER pclabSave the file (type
C-x C-s
) and exit from emacs (type
C-x C-c
).
logout
command) then log back
in.
Did you notice that your command line prompt has changed? It now shows the
machine name and the directory you're in (~
is the abbreviation for
your home directory).
After logging back in, you can run emacs
just by typing
emacs
.
/usr/local/info/password
for advice on choosing a good password:
less /usr/local/info/password(The shell you're using has file completion. Type the command above up to
/usr/loc
and press the Tab
key. The rest of the path
component --- al
--- will be filled in for you. This saves typing
when you have long filenames)
Within less
, use the space bar and b key to move down or up,
respectively, a page. Type q
to quit less
.
emacs
, create a file named name
containing your
name. Print the file:
lpr nameThe file should be printed on the printer in HS 149. If you ever want to print to the printer in the X Lab, you must use the
-P
switch:
lpr -Pps <filename>Remove the file you just created:
rm nameUnlike Windows, once you remove a file in Unix, it is gone for good. So be careful!
/etc
:
cd /etcYou can verify that you're where you think you are by running the print working directory command:
pwd
.
Using the ls
command, list the files in /etc
. Too many to
fit on a single screen? Pipe the output to the paging program:
ls | lessRepeat again using the
-l
option to ls
What's the
difference?
cd
without
an argument). List the files in your home directory. Try again using the
-a
option. What's the difference? Read the man page for ls
to read about these two options and find what other options are available:
man ls
~kelliher/pub/cs245
and use cp to copy
Prog.java
to your unix1
directory:
cp Prog.java ~/unix1
unix1
directory and compile the
program:
javac Prog.java
java Prog