The lab comprises
a cluster of workstations running Debian Linux with a central file
server. The machines are located in SC 347 and are also available
for remote login using SSH and VNC (see remote
login to the right).
The lab is used primarily for upper-level
Computer Science and Computer Information Systems classes but is
also available for general use by other Wartburg students. If you
would like an account contact Dr.
John Zelle.
The default desktop environment on
these machines is KDE, but others are also available. Standard software
includes programming environments for C, C++, Java, Python, Perl,
Prolog, Scheme, and COBOL as well as text-formatting utilities (Latex),
editors (emacs and vi) and a host of productivity programs, image
viewers/editors, and of course games.
Selecting
a Shell
To some extent, the "feel" of interacting
with a Unix system depends on the command interpreter or "shell"
that you are using. Different Unix systems have different shells,
and users can often select among a number of different shells to
suit their own tastes.
The most commonly used shell in the Linux world is "bash".
It is an enhanced version of a traditional shell known as the Bourne
shell. Bash is the "Bourne-again shell". Some other
common shells are based on the original "C" shell (csh).
Shell Features (tcsh and bash)
- Command recall.
You can cycle through previous commands
using the up and down arrows.
- Command/filename completion.
If you type the first few characters
of a command or file/directory name and then press the tab key,
the shell will attempt to complete the command or name. If there
is more than one valid completion, the shell will complete the
command up to the ambiguity. Pressing tab again will show the
possible completions.
- Filename wildcards.
You can specify a "set" of files
using "*" to represent a sequence of characters. For example,
"foo*" matches all the files starting with "foo".
Environment Variables
Environment variables are are often used in Unix to set general properties of the system. For example the variable PATH determines what directories will be searched when trying to lookup a command. DISPLAY determines the machine on which windows will be displayed when using X, the Unix graphical interface. Some useful commands:
- echo $<variable> display
the contents of the variable. Example: "echo $PATH"
- setenv <variable> <value> (c-shells only) set the value of a variable. To add a new directory
to a path, a c-shell user would do something like "setenv PATH
${PATH}:/home/myfiles/bin". The ${PATH} is the old value of PATH
and causes the new directory to be appended.
- unsetenv <variable> (c-shells only) clears out an environment variable. For example,
for a text-based login session, a user might to "unsetenv DISPLAY"
so that certain commands (e.g. emacs) do not try to create a window.
- <variable>=<value>;export<variable> (Bourne-shells) sets the value of an environment variable. Note
there should be no spaces around the "=". Example: "PATH=${PATH}:/home/myfiles/bin
; export PATH"
- <variable>= to unset
a variable. Example "DISPLAY="
Sometimes there are some variables
that we always want to set. We can customize the environment automatically
by placing shell commands in a file that is automatically consulted
when the shell starts. For bash, the commands in ".bash_profile"
are performed on login, and those in ".bashrc" are performed whenever
a new shell is started.. For c-shells, the commands in ".login"
are performed when you login, and those in ".chrc" are performed
each time you start a shell. Usually, you would modify the commands
in .login. Note these configuration files start with ".", so they
are hidden files (see section on files).
Job Control
To execute a command,
simply type the name of the command at the shell prompt. For example,
to start the emacs text editor, type: emacs <enter>. When the command has finished executing, you will get
back the shell prompt. Putting an "&" at the end of a command
causes it to run in the background. That is, the shell prompt returns
immediately so that more commands can be issued. The background
command will run concurrently with any subsequent commands. In this
fashion, it is possible to be running multiple "jobs" at the same
time. Here are some commands for manipulating multiple jobs:
jobs list the currently
running jobs.
<ctrl>-z suspend the
current foreground job.
bg restart a suspended
job in the background.
fg restart a suspended
job in the foreground.
kill %<number> kill
(terminate) the job with the given number (obtained from "jobs").
kill -9 %<number> terminate
with extreme prejudice.
Files
and Directories
Unix maintains a tree-structured
directory system. When you log in, you are automatically placed
in your "home" directory. You can make subdirectories to organize
your files. In referring to directories, there are some special
conventions:
- '~' represents your home
directory (can also use '$HOME')
- '.' represents the current
directory.
- '..' represents the parent
of the current directory.
File-handling commands:
ls list files in directory.
ls -l directory listing
in extended format
ls -a directory Listing
including hidden files (starting with ".")
- mkdir filename create a new (sub)directory
- cd directory
- Change directory
- cd .. change to parent
directory
- more filename display
contents of file one page at a time
- cat filename display
contents of entire file
- rm filename delete
the specified file
Other Essential Commands
- exit leave current command
shell. At top-level, this logs you out
- passwd change password
on local machine. In the UCL, this command is an alias for yppasswd
- yppasswd change your password
on central password server
- man command display
manual page entry describing the command
- man -k term display
commands related to this term
- xterm (or konsole) &
start up a graphical terminal (only used under X-windows)
Emacs is a very powerful
multi-windowing text editor. You can get a tutorial by typing
<Ctrl>-h t (Control-h followed by a t) from the fire-up
screen. If you are brand new to emacs, it would be worth your
while to walk through it. In the commands below, the notation
"C-" indicates a control character (hold down <Ctrl>
and type the character), and "M-" indicates a meta-character.
On most terminals, a meta character is obtained by prefixing the
character with <Esc> (i.e. push and release the escape key
before hitting the character). Some terminals may have an <Alt>,
<Edit> or <Meta> key that works like a <Shift>
for typing meta-characters.
Cursor
movement:
Some terminals
may allow use of arrow keys, if not:
- C-f forward one
char
- C-b backward one
char
- C-p up to previous
line
- C-n down to next
line
- C-a beginning of
line
- C-e end of line
- C-v scroll screen
down
- M-v scroll screen
up
- M-> end
of file
- M-< top
of file
- C-l re-center screen
on current line
-
File
manipulation:
- C-x C-f open or
create a file
- C-x C-v replace
buffer with a different file
- C-x i insert file
at current cursor position
- C-x C-s save buffer
to file (This may hang your terminal, use
- C-q to restart
it).
- C-x s save all
changed buffers.
- C-x C-w write buffer
to file (will prompt for file name).
- C-x C-c save buffers
and exit emacs
- C-z suspend emacs
(use "fg" to restart where you left off)
-
Help
commands:
- C-h enter help
system
- C-h f get help
for a given emacs command
- C-h k get help
for a certain keystroke sequence
- M-x "apropos" Find
commands relevant to a key word.
-
Editing
Commands:
-
<delete> or <backspace> Delete previous character
- C-d delete the
current character
- C-k cut to the
end of line into "clipboard"
- C-<space> to
mark the beginning of a region.
- C-w cut region
between mark and cursor.
- M-w copy region
between mark and cursor to clipboard.
- C-y "yank"
(paste) clipboard text back into buffer at cursor.
- C-_ or C-x u undo previous
edit (can go back multiple steps).
-
-
Buffer
manipulation:
- C-x 2 split screen
into two windows
- C-x 1 revert to one
window
- C-x o switch to other
window
- C-x b change buffer
displayed in this window.
- C-x k kill this buffer
(close the file).
-
Searching:
- C-s incremental search
forward
- C-r incremental search
backward
- <esc> exit
a search
- M-% search and replace
-
Compiling:
- M-x "Compile" Start
a compilation. Emacs will prompt for a compiling command
(suggesting "make -k"). Enter the appropriate command (i.e.
"g++ -o myprogram myprogram.cpp")
- C-x Cycle through
messages in the compile buffer. Emacs will show the line
on which the error is reported in the editing buffer.
-
Universal
panic:
|
Current machines
available:
- molly.wartburg.edu
- neon.wartburg.edu
- loach.wartburg.edu
- clown.wartbur.edu
- guppy.wartburg.edu
- danio.wartburg.edu
- barb.wartburg.edu
- gourami.wartburg.edu
- cichlid.wartburg.edu
- oscar.wartburg.edu
- lion.wartburg.edu
- dojo.wartburg.edu
Secure Shell
The UCL supports access through secure shell (ssh). You just need point an ssh client at one of the machines in the cluster.
Windows
Windows does not
come with an ssh client but there are many good one available
for free. I like PuTTY. When
you run PuTTY, make sure to check the SSH protocol box, as Telnet
is the default.
Linux
Most Linux distributions now come with an ssh package. With
this package installed, logging into the lab is as simple as
typing a command such as: $ ssh zelle@molly.wartburg.edu
Macintosh
I'm not sure what the status of free SSH clients for
the Mac is. I know there are some nice shareware products. You
might check with Dr.
Breutzmann.
Virtual
Network Computing (VNC)
VNC is a thin-client
protocol that allows for a remote graphical login giving you
a remote working environment that is just like what you would
get if you were actually sitting at one of the UCL machines.
In order to use VNC,
you need to have a VNC client for your local machine. I recommend
TightVNC; you can find VNC clients for Unix and Windows at the TitghtVNC Homepage. Most
Linux distributions come with a tightVNC client.
Starting a VNC session
is very simple. You do not need to ssh into a machine to start
up a vnc server, just point your vnc client to the machine you
want to use and give it a desktop number indicating the resolution
of the connection you want. For example, to connect to neon, you
have the following choices:
neon.wartburg.edu:0 A 1024x768 16 bit color desktop. Good for relatively fast machines on an excellent network connection.
neon.wartburg.edu:1 A 800x600 16 bit color desktop. Good for moderately fast network connection
neon.wartburg.edu:2 A 640x480 8 bit color desktop. Use this when network bandwidth is lousy.
You don't need to
specify any VNC password for the login. When VNC connects, you
will be presented with the normal login screen, just like you
get when sitting in the lab. Just login and use the session. When
you logout of the desktop, your VNC session will be automatically
terminated.
File Transfer
You can transfer files
to and from the UCL machines using SSH with either an SCP or SFTP
client. Most Linux distributions come standard with both SCP and
SFTP as part of the standard SSH package. For Windows, a good, free
client is WinSCP.
For the Macintosh, there are a number
of good shareware programs available.
|