ERODD HOME
UNIX Lab Information -
Fall 2006
Earl Rodd
erodd@malone.edu Extension 8546 www.malone.edu/erodd
Updated 08/29/06
Booting the Lab Systems
- The TS111 lab has LINUX installed on all the sytems.
- When the system boots, a program called "Grub" runs
which is a "boot manager" and determines which partition of the disk
is booted. A selection screen will appear for 10 seconds.
- On most systems,
Windows is the default, so if you do nothing within 10 seconds,
Windows will boot.
- On some systems, LINUX may be the default. These will be marked in
the lab! Someone else may, however, have booted them into Windows.
- To boot LINUX, on the Grub screen,
move the cursor down to the first "Ubuntu" entry and press ENTER.
Booting LINUX if the System is Running Windows
- If you are in Windows, press START, Shutdown, Restart, and then select
the first Ubuntu entry when "Grub" comes up.
- If Windows is at the default screen, waiting for Alt-Cntl-Del for login,
then press Alt-Cntl-Del and select Shutdown/Restart.
Rebooting Windows
On those systems for which LINUX is not the default, you should
reboot Windows before leaving the lab.
When you are done with Linux, you may reboot back to the Grub point (from
which the system will boot Windows if you do nothing) by either:
- Click on the "power button" icon at the top right of the screen and
then click on "Reboot".
- On the menu bar (Panel) select System->Quit->Restart
Note: Normally, non-root users do not have priviledge to reboot. The
lab systems were configured this way so that users do not have to
login root just to reboot back to windows.
Using LINUX
- When you are in a X-Session, we have provided a Desktop manager called
"gnome". This manager has some of the look and feel of Windows.
On the "panel" - top bar on the screen - are
some standard functions. To open a terminal (console)
window, press the icon which looks like a little terminal.
In a terminal window, you can bring up the most recent command. This
is done differently depending upon which "shell" we use. The "repeat" key
in the shell we are using (BASH) is the up-arrow. If you go too far in the
stack of commands, you can use the down arrow to come back.
- The userid's initially available are:
Accessing Your hdrive and the Instructor tdrive
- You can get to your hdrive (and get the courses folder with the
ERODD directory) by typing:
mnet logon student userid
This will prompt for your password. This is your normal
network password you use in Windows. You cannot print or access your H:
drive unless you login.
Your hdrive will now be:
$HOME/hdrive
Your t-drive will now be:
$HOME/tdrive
- You can unmap your drives with:
mnet logoff
- Note: mnet will mount the hdrive in $HOME/hdrive and the
tdrive in $HOME/tdrive. For example, if you are logged on to "square", then
$HOME is /home/square.
Even if you login from another session (e.g. Cntl-alt-F2),
these directories are still mounted!
- When you first login to userid "square", your current directory will
be $HOME (/home/square). Therefore, to make your hdrive the
current directory, just type:
cd hdrive
- If you hdrive is your current directory, then to make the
instructor tdrive your current directory you would type:
cd ../tdrive
The ".." means go back one level (to /home/square).
Printing
You cannot print on LINUX unless you have logged in!
(see mnet discussion above).
Printing will normally be done using the command a2ps:
a2ps filename
Console Sessions
Note: While we will normally stay within the window manager,
you can use UNIX "console" sessions.
When you enter LINUX, the session which comes up is in a windows manager
using the X-protocol. You can get to console sessions by going to alternates
by: From the Xwindows session, press alt-cntl-Fn to get to console session
n (n=1-6).
This provides a console session.
You can switch between sessions by pressing ALT-Fn (The X-manager session is
at Alt-F7).
Editing Files
Editors to edit your files. The standard UNIX editor is "vi".
A tutorial on this editor is here. This editor
is available on ALL UNIX systems. Actually, on our lab systems, "vi" is
an enhanced "vi" called "vim". If you use "vi" on other UNIXs, you may
find some features missing (e.g. the display of line/column number).
The lab systems also provide several GUI editors more like NOTEPAD.
One of there is called "gedit". This is available either from the command
line or from the Panel as Applications->Accessories->Text Editor.
Browser
The browser on these systems is "Firefox", an open source
Netscape like browser. There is an icon on the
task bar to start the browser.
Basic UNIX Commands
The following are basic UNIX command line commands which can be used in
a console window or on a console session.
Note: In UNIX/LINUX, filenames are case sensitive. That is,
files "File1" and "file1" are two DIFFERENT filenames!
- ls
- Lists all the files in the current directory.
- ls -l
- The -l says show full information (e.g. size, date/time updated).
Like DOS "dir".
- ls -lrt
- The -lrt says show full information and sort in reverse time/date order so
that the newest files are shown last.
- cp filename1 filename2
- Copy filename1 to filename2. This will overwrite an existing filename2.
Note: filename1 and filename2 can be either fully qualified
names (e.g. /home/public/myff1.java) or assumed to be in the current
directory.
- mv filename1 filename2
- Move filename1 to filename2. I.e. a rename function.
- rm filename1
- Remove filename1. Like DOS "erase."
- pwd
- Show the current directory.
- cd pathname
- Change current directory. Just like DOS "cd".
- mkdir pathname
- Make a new directory. Just like DOS "mkdir".
- command | more
- Command is ANY UNIX command. This pipes the output to "more" which
will stop when the screen is full and wait for you to press the
space bar to show the next screen.
- grep string filename1
- Search the file filename1 for all lines containing string. For example,
"grep Text psamp.java" will show the lines in file, "psamp.java" which
contain the string "Text".
- lpr filename
- Print filename on the default printer. In the TS111 lab, the default
printer is the lab printer.
HOWEVER in our labs, the printers are configured for Windows
text files, not UNIX, so using lpr to print text prints incorrectly.
On our LINUX, use the command:
a2ps filename
This converts the text to postscript with a nice formatting.
The problem is that Windows files have a CRLF (carriage return AND
line feed) after each line. In UNIX, there is only a NL (new line - same
binary code as line feed).