Introduction to UNIX
How to Access the Sun in Dailey
Basic facts:
To access the SUN workstation requires a valid user account (userid) and a computer terminal. Accounts can be obtained by filling out the on-line form at http://www.acs.brockport.edu/cgi-bin/acctmailit.cgi
User ID:
Your "user ID" is your first initial, your last initial, and the last four digits of your Social Security number. {e.g. John Doe, 012-34-5678 =jd5678}
Password:
Your "password" will be your first initial followed by the first five digits of your Social Security number. {e.g. John Doe, 112-34-5678 = j11234}
Login from:
Users can login from the Sun Workstations in 213 Dailey, any Dailey Hall terminal or PC, or from your home or office through the Internet.
a. Sun Workstation If the monitor is turned off, turn it on. Press the <ENTER> key once or twice. When the monitor warms up, the CDE login screen will appear. At the CDE login screen, type your user ID and then your password.
b. Terminal (Dailey) If you want to access the SUN from the terminals in Dailey, follow these steps.
Step 1 Turn on the terminal. You will see the following message on the screen:
DSS::DLY:4T7-1
Welcome to the SUNY BROCKPORT Data Network.
NODE: DLY Select Destination:
Step 2 type: telnet
Connected to
DLY:7T26
ACSELS1::PORT_26
Equinox ELG-48
SUNY Brockport
Academic Computing Network Terminal Server
SUNYBKPT>
Step 3 type: telnet <machine name> {e.g. <machine name> = seahorse}
SUNYBKPT -010-
Session 1 to TELNET established
UNIX(r) System V Release 4.0 (seahorse)
Step 4 Type your user ID at login prompt and password at password prompt.
After successful login the SUN system will prompt "seahorse%".
c. Internet/Dailey PC PCs in Dailey Hall or computers connected to the Internet will have a program called "telnet" installed for accessing remote computers over the Internet.
To connect to the SUNY Brockport Sun workstations from a remote site over the Internet, follow these steps:
Step 1: Connect the system to the Internet if it is not already connected. In Windows 95, this usually means clicking on an icon and waiting for your modem to dial an Internet Service Provider (ISP), such as Frontier, Compuserve, or AOL.
Step 2: Locate the "telnet" utility. In Windows 95, the program is C:\WINDOWS\TELNET.EXE. Use "Run" from the Start menu to start telnet.
Step 3: Enter your destination. For some telnet programs, this means typing
connect <machine name>. In Windows 95, click on the "Connect" menu, and select "Remote System". Type in the <machine name> in the "Host Name:" field, and click on [CONNECT]. Possible <machine name> selections
starfish.acs.brockport.edu
(preferred)
stingray.acs.brockport.edu
Logout:
Type exit or logout to disconnect from the 'telnet' session.
UNIX Shells:
The shell is a powerful command interpreter where most user interaction takes place. Think of the shell as a DOS (C:\>) prompt on steroids. Any commands outlined in this document are entered at a shell prompt. The default shell for users of the Sun workstations is the "C-shell", csh.
Graphical User Interface:
The default Graphical User Interface for Sun is the Common Desktop Environment (CDE). CDE provides an intuitive "point-and-click" interface to the Sun Solaris operating system. Please refer to the document "Introduction to the Common Desktop Environment" for details on the CDE.
Starting a Shell:
If you are accessing the system through the PCs/terminals in Dailey Hall, or through the Internet from your office or home, a shell is started automatically. You know that you are in a shell by the presence of a "command prompt". If you logged into the machine named "seahorse", the command prompt will look like this: seahorse%
To access a shell in the CDE, you start what is called a "terminal window". Please refer to the document "Introduction to the Common Desktop Environment" for details on terminal windows.
Command Syntax:
command [-options] [arguments]
Options always start with a hyphen "-"
Security:
You should change
your password when you log on for the first time.
To change your password, type: passwd
Example The following example illustrates the passwd command.
acssun1% passwd
passwd: Changing password for reddy
old password: <passwords don't appear while you type>
new password:
Re-enter new password:
Note : Change your password often to avoid unauthorized use of your account. Passwords must be a minimum of 8 characters long and should contain at least one or more special characters (@, #, !, &, etc.).
Shell Commands
create alias alias
name command
set shell variable set var name
set environment variable setenv
create multiple shell layers sh
print process information ps
list process id numbers ps -e
stop a job ^z
terminating jobs kill -9 pidno
see shell history history
repeat last command !!
display last command !!:p
command line n !n
first argument of last command !^
last argument of last command !$
all arguments of last command !*
substitute old with new in immediately
previous command ^old^new^
Display files & directories:
list filenames
ls
filenames/directories ls -F
all files (including hidden ) ls -a
long file list (including permissions) ls -l
list files by time ls -lt
Copy, move files & directories:
copy file cp
old new
copy file to directory cp file dirname
change file permissions chmod {ugo} {+-}{rwx}
rename (move) file mv oldfile newfile
delete (remove) file rm file
remove files recursively rm -r dirname
link files ln file1 file2
append file1 to file2 cat file1 >> file2
compare the contents of two files cmp file1 file2
search for a pattern grep pattern file
count words, lines characters wc file
sort file ascending (default) sort file
Print file:
print file (Color
Inkjet printer) lp -d color file
print file (Laser printer) lp -d laser file
view print queue lpq -Pprinter
cancel print lprm jn (job id)
View file:
with more more
file
with concatenate cat file
Meta characters:
single character
?
multiple characters *
range [c-c]
On-line help:
displays manual
pages man command name
search for manual pages apropos keyword
Directories:
change to home
directory cd
change to root directory cd /
change to parent directory cd ..
present working directory pwd
make a directory mkdir dirname
change directory cd dirname
remove directory rmdir dirname
Utilities:
compress file compress
-v file
uncompress file uncompress file
calendar cal
list current users who
current date and time date
find a file (Home directory) find $HOME -na filename -print
eject floppy from the drive eject
Mail:
start the menu-driven email utility pine
UNIX Editors:
The UNIX operating system provides different editors that allow users to create and modify files. A common editor is vi, a very powerful, but somewhat difficult to learn editor. Another powerful editor is emacs. A much easier to use, menu-driven text editor is pico, which is based on the pine email utility.
edit a file with
vi vi filename
edit a file with emacs emacs filename
edit a file with pico pico filename
Information on each editor can be found in many places. Academic Computing Services provides help sheets for both the vi and emacs editors. The pico and emacs editors have their own on-line help facilities. In addition, the World Wide Web can be searched for on-line user's guides for all three editors.