last updated 1/17/08
A popular, open operating system developed in early 1970's at Bell Labs (AT&T).
Note that the Suns here all share the same file system, so it doesn't matter which you log into.
We will use the Unix workstations found in C102 that are Solaris based. These machines are local to Eaglenet. You will need to connect to the campus network via VPN or RAS first to access these machine from off campus. The workstation names are:
|
|
We will use the Common Desktop Environment GUI (CDE) on the Suns accessible via an X-window application called Cygwin. Cygwin should be found as a preinstalled application in C102. You will need to choose one of the above workstation names on the opening screen.
To install Cygwin on your own computer, visit the link http://www.cygwin.com/ and be sure to install the Xwindows components.
On a windows machine, once you start Cygwin, at the command prompt you should
type:
xwin -query hostname -clipboard -fp tcp/hostname:7100
The above command allows you to use the clipboard, to cut & paste data from windows to Unix, and uses the Sun's fonts.
You can remove the -clipboard and -fp tcp/hostname:7100
options, if you wish, and simply use:
xwin -query hostname
When logging into Solaris, be sure you choose CDE as the environment (on the login screen choose Options, then Session, then Common Desktop Environment)
Unix usernames are set to be the same as on Eaglenet but the passwords are saved in different places.
Access to the Sun workstations can also be done from a terminal session on a PC (using any telnet application such as putty). You want to typically use a VT100 style emulator. This is not a graphical interface--it is purely text.
The general command from any PC command line is
C:\> telnet workstation
Your login name/account is set up to be the same as on the Eaglenet.
A password prompt should not appear the first time you log in. You will have to keep track of this separate password.
passwd is the command to set/change passwords.
logout is the command to terminate your Unix session.
Be careful: ^D (Ctrl-D) also can cause you to log out.
You may also use the PuTTY software for telnet or ftp access to the Unix machines from Windows. The URL for downloading is: http://www.chiark.greenend.org.uk/~sgtatham/putty/
There are a number of ctrl-key combinations that you should be familiar with. The first three are the most important.
| Key combination | Purpose |
|---|---|
| Ctrl-D | End of input (logout) |
| Ctrl-C | Interrupt; stop, cancel current program |
| Ctrl-Z | Suspend current program (you probably want Ctrl-C) |
| Ctrl-S | Stop screen scrolling |
| Ctrl-Q | Resume screen scrolling |
| Ctrl-H | Backspace |
| Ctrl-J | Linefeed |
| Ctrl-L | Pagefeed |
| Ctrl-R | Redisplay the current command line |
You normally will work in a terminal window for this course. The terminal window runs a "shell".
The "shell" is the command interpreter part of Unix which repeatedly carries out the following actions:
The shell itself is a command: csh
Other shells exist. sh is the original Unix shell. ksh is the Korn shell. bash is a shell found on Linux.
Unless you are familiar with other shells, it is recommended to use csh as your shell for this course.
command [-switch-option ... ] [argument-list ... ]
Commands are simply file names (executable);
options are typically prefixed with a hyphen;
arguments are often filenames
The "[ ]" mean the contents are an optional part of the command and "..." mean that more than one of the items can occur.
The command, options and arguments are separated by spaces.
Examples:
ls |
list directory contents; filenames only |
ls -l |
list directory "long"; give details |
ls -a |
list directory "all"; list hidden files that start with . |
ls -F |
list directory contents; flag different file types |
ls -l filename_with_wildcards |
list files that match the pattern |
who |
show who is logged on to the workstation (not across the network or other workstations) |
cat filename |
type out the contents of filename |
mailx username |
construct a mail message to the user or email address |
man command |
"manual" reference for command; this is the Unix help command |
ps [-el] |
show processes -e=all -l=long details |
Aliases can be used to define alternate names for commands.
.cshrc is the standard file to define aliases if you're running csh.
A .login file exists and is executed upon login if csh is your default shell. A .profile file can serve similar purposes for other shells (sh or ksh).
The .cshrc file is executed every time you start a csh shell, which may occur more than once in a log in session. For example you may use the workstation console to have several csh windows up at once.
- How old were you when you started programming?
- Do you think you will need a lot of patience to master Unix?
- Do you have a favorite TV show? If so, what is it?