Computing Resources @ Office of Information Technologies



Quick Links




Resources

Computer Accounts

Web Resources

Mailing Lists

E-Mail

Printing

Student Records(Banweb)


Related Links

Helpdesk

Academic Computing Services

Computing and Network Services

WebCT Courses

Instructional Multimedia Development

Computer Action Team


HOME






Procedures and Commands to get you started in UNIX





Getting started using ODIN

What is UNIX? [Back to Top]

UNIX is the operating system that runs on the PSU ODIN servers. UNIX controls access to the computer, manages your files, prevents users from interfering with each other, and provides the environment application programs need to be able to run.

Logging In [Back to Top]

Open a ssh session to odin.pdx.edu. After you have connected to ODIN you are now logged into a timesharing computer that runs the UNIX operating system, you'll see

SunOS 5.6 login:

Enter your username and press Return. You'll see

Password:

Enter your password and press Return. (It won't be displayed). If you entered your username and password correctly, you should see a numbered %, the UNIX command prompt. If you made a mistake entering your username or password, you'll see the message

Login incorrect login:

Try reentering your username and password again, just in case you made a typing error. (Keep in mind that uppercase and lowercase characters are not interchangeable in UNIX.) If you continue to be unable to log in, you may need to have your password reset.

Changing Your Password [Back to Top]

Every few months you should change your password.

The best way to change your password is through the web at: http://www.account.pdx.edu/passwd

Or at the UNIX prompt Type

% passwd

You'll then need to verify the change as follows:

Enter login(NIS) password: type your old password
New password: type your new password
Re-enter new password: type it again

If your new password is too short, is a word in the dictionary, or is otherwise easily guessable, it may be rejected. A password will need to be 6-8 characters long, and will need to contain a mixture of uppercase letters, lowercase letters, characters, or numbers.

Using ODIN's NETWORK ACCESS MENU [Back to Top]

For help on using ODIN's Network Access menu see the documentation at the Helpdesk.

Getting Help with Commands [Back to Top]

UNIX commands are normally documented in online manual pages. For example, if you'd like to see information about the find command (list files), you'd type

% man find

The first screen of the man pages for find is displayed:

- To see the next page, press the spacebar
- To see the preceding page, type a b
- To see other options, type an h
- To quit, type a q

To search all manual pages for entries about a topic (like "find"), type

% man -k find

To retrieve an entry from a specific manual page section (e.g., to see the find entry from section 4), type

% man -s 4 find

Logging Out [Back to Top]

To log out when you're finished, type

% logout

If you get the message, "There are stopped jobs," you've accidentally stopped execution of a command by hitting a Ctrl/Z sometime during your session. To log out in this situation, first see which jobs are stopped by typing

% jobs

To restart a stopped job (e.g., job number 2), type

% fg %2

You can then continue your work on that job. When you finish, restart the next stopped job and finish working with it, and so on. You should then be able to log out normally. If you want to log out, regardless of the status of other jobs, type the logout command twice:

% logout
% logout

Useful UNIX Commands [Back to Top]

The command summary shown below is intended merely to serve as a quick refresher to jog your memory if you forget a basic UNIX command.

Working with Files

What files are in my directory?
ls -la | more
What's in file readme.txt?
more readme.txt
Copy file source.txt to file dest.txt
cp source.txt dest.txt
Rename file old.txt to file new.txt
mv old.txt new.txt
Delete (remove) file myfile
rm myfile
Find string "xyz" in letter.txt files
grep xyz letter.txt
Sort file mylist, creating mynewlist
sort mylist > mynewlist

Editing Files

Create (or edit) file mynewfile
pico mynewfile

Working with Directories

What directories do I have?
ls -ld * | grep "/"
What directory am I in?
pwd
Make directory mystuff
mkdir mystuff
Move file document.txt to directory mystuff
mv document.txt mystuff/
Move file mailfiles up a level
mv mailfiles ..
Change to directory mydocuments
cd mydocuments
Change up one directory level
cd ..
Move to your default directory
cd
Delete (empty) directory trash
rmdir trash

Miscellaneous Commands

What jobs are running?
ps -ef | more
Interrupt/abort current task
Ctrl/c

UNIX File Permissions [Back to Top]

Setting Default File Protections for New Files

Default file protections leave most new files readable to any user on your system who may attempt to look at them. To change this for files you create in the future, use Pico (or any other text editor) to change the default file permissions.

NOTE: If you want to publish files to the web DO NOT change the default file permissions unless you know what you are doing.

First make sure you are in your home directory.
% cd
Second open your .login file using an editor.
% pico .login
Move to the bottom of the file using the arrow keys.
At the bottom of the file insert the line:
umask 007
Type Cntl/x to save the file.

Setting File Protections for Existing Files

Make file assignment.txt unreadable by others.
chmod o-rwx assignment.txt
Make file document readable by everyone.
chmod a+r document
Make directory projects readable by everyone.
chmod a+rx projects
NOTE: For a more complete discussion of file permissions check out "Controlling access to your files and directories" from the UnixHelp system.

Some Basics of Using the TC Shell [Back to Top]

Many so-called UNIX commands are actually provided by the TC Shell. Take a look at the manual pages for tcsh (i.e., man tcsh).

Commandline File Completion

Complete partial filename
type part of name, then tab
Show all possible completions
type part of name, then Ctrl/d

Working with the Command Line Editor

Re-execute the last command
!!
What commands have been executred?
history
Re-execute the 17th command
!17

Combine Commands and Redirect Output

Pipe output from command myprog into command sort
myprog | sort
Write the output from command finger into file people
finger > people
Make command a.out take its input from file friends
a.out < friends

TC Shell Job Control

Make the current command pause, then restart in the background
Ctrl/z % bg
Run command calculate in the background
calcuate &
What background jobs are running?
jobs
Make job 2 run interactively
fg %2

Changing Your Default Editor from Pico to vi

% pico .login
(use arrows to move below the # Any Variables that you would like to set yourself should go after here. line)
Add the following line:
setenv EDITOR /usr/bin/vi

type a Ctrl/x

If You Damage Your .login File ...

If you damage or delete your .login (TC and C shell initialization) file, your account will not work properly and you'll need a fresh copy of the file. To get one, type

% /usr/local/bin/updotfiles







This page maintained by: support@pdx.edu