Computing & Information Services
A Guide to UNIX
- Accessing Unix from MacOS X
- Accessing Unix from Windows
- Changing Your Password
- Unix Commands
- Panicking in Unix
- Logging Out of Unix
- Email in Unix
- Navigating Directories in Unix
- Word Processing in Unix
- Reading a File from the Prompt
- Removing a File
- Creating a Directory
- Removing a Directory and its Contents
- X Windows
Accessing Unix from MacOS X
Since OS X is UNIX based, it already comes with a UNIX terminal. To access it from your computer, open your hard drive and select the Applications folder, then the Utilities folder, and finally double click on Terminal.- If you are on an IRC computer, the Terminal icon will be in the dock. When the Terminal is open, you will be presented with a prompt.
- Type in ssh <username>@oberon.reed.edu, where <username> is your Reed network username. Your Reed username will most likely be a combination of parts of your first and last name. Hit Return.
- It is possible that you will get the message shown below. If this is the case, type yes and hit Return.
- At the prompt, type in your network password and hit Return. When entering a password in UNIX, no text will show up, and the cursor will not move- this is a security feature that helps prevent people from seeing or guessing your password.
- If you make a mistake in typing, you will be asked to start over by entering your password again. If this fails several times there may be a problem with your account; check with a CUS staff member in the ETC.
- Some messages will scroll onto the screen. These are messages addressed to everyone. They're important; you should take the time to read them.
- A UNIX prompt will now appear. It is usually a dollar sign ($) and it indicates that the UNIX machine is ready to accept commands.
Accessing Unix from Windows
- In order to access UNIX from Windows, you will need to download PuTTY. It is a stand-alone program: you do not have to install it.
Double click on putty.exe.- The PuTTY Configuration window will open. For Host Name, type oberon.reed.edu.
- For Protocol, make sure SSH is selected.
- Click Open.
- If you are presented with a host-key acceptance dialog, click Yes to continue connecting.
- You will be prompted for your server login and password. Type your login and hit Return. Type your password and hit Return. When you type your password nothing will show on the screen. If you make a mistake in typing, you will be asked to start over by entering your password again. If this fails several times there may be a problem with your account; check with a CUS staff member in the ETC.
- Some messages will scroll onto the screen. These are messages addressed to everyone. They're important, you should take the time to read them.
- A UNIX prompt will now appear. It is usually a dollar sign ($) and it indicates that the UNIX machine is ready to accept commands.
Changing Your Password
- Once you've logged on successfully, you can change the password you have been given. This acts the same as changing your password through Kerberos. You should mix upper and lowercase and special characters to make your password unique and hard to guess. It must also be at least 7 characters long.
- Type kpasswd after your prompt and press Return.
- When it prompts you, type y to indicate that you do wish to change your password.
- Type in your current password after "Password for <login>@REED.EDU:" appears (Be aware that no text will appear as you type passwords, to prevent others from reading over your shoulder).
- Carefully type in the password you want after "Enter new password."
- Re-type your new password for verification.
- Press return when you are finished. If you don't see the message "Password changed", you probably typed your new password incorrectly and should try again.
- Users who encounter an error stating: "kpasswd: No credentials cache found getting principal from ccache" should first acquire a ticket by typing "kinit" and then authenticating before attempting kpasswd again.
Unix Commands
Items enclosed in <> are variables, meaning you should type in the name you want but not the <>. Items in courier are commands. The ^ means press the control key and the command letter at the same time. All commands are typed at the Unix prompt; press Return after them, unless otherwise noted.
The Basics
- man is the most important UNIX command. It displays a complete help page on a given command.
- Usage: man <command> (e.g., man passwd, man pico, man man)
- Press Return to scroll down one line.
- Press B to scroll up one screen.
- Press up and down to scroll normally.
- Press Q to quit and return to the prompt.
- passwd will let you change your password. Good passwords are at least 7 characters in length, are made up of numbers, letters and symbols, and are not real words in any language. Please see the section on Changing your Password for more details.
- more and less are text viewers. They show you the contents of a file one screen at a time in plain text. Pressing space displays the next page. Usage: more <filename>
- jobs will list the number and type of jobs you currently have running. For each job listed that you would like to quit running, type kill <jobnumber>, where <jobnumber> is the large, unbracketed number next to the job name.
- ^C (control-C) kills whatever process you've recently started if you don't know how to quit it.
- ^Z (control-Z) suspends whatever program you're currently running and puts you at the Unix prompt so you can do something else. Type fg to get back into your program.
Using the File System
- ls lists the files in the directory you're currently in.
- ls -a lists all the files in that directory, including the ones which start with a "." (like .profile).
- ls -l lists detailed information of each file.
- du -k displays the amount of disk space your directories are using in KB. Remember to keep your directory within the disk quota (100000 KB is standard). du -ks gives the summed total of your home directory files and du -ks /usr/spool/mail/<login> gives the total for your mail inbox.
- cp copies a file. Usage: cp <source file> <target file>.
- mv moves a file. Can also be used to rename a file. Usage: mv <source file> <targetfile>
- rm -i removes a file. Usage: rm -i <filename>
- cd moves you between directories. cd by itself takes you "home." Usage: cd <pathname>
- pwd (print working directory) tells you what directory you're currently in.
- lpr -P<printername> <filename> prints a postscript file. Note the lack of a space between —P and the printername.
- enscript -P<printername> <filename> prints a text file (this includes email files).
Compression Commands
- gzip compresses the file you specify. After compression, your file will have a .gz suffix. Usage: gzip <filename>. You can use gzip -9 to compress your file almost 90%. Default compression is 50%. Be patient; the bigger the file, the longer it will take.
- gunzip uncompresses a file with a .gz suffix. Usage: gunzip <filename.gz>
- uncompress uncompresses a .Z file. Usage: uncompress <filename.Z>
- tar -xvf uncompresses a .tar file. Usage: tar -xvf <filename.tar>
Mail and News
- ipine lets you read and send email. Your command options are at the bottom of the screen. For more information, see E-Mail in UNIX.
- trn lets you read and post to USENET newsgroups. The command l <topic> will show you a list of those groups that have that word in their name. g <newsgroupname> subscribes you to a newsgroup. u unsubscribes you from the newsgroup you're in. h gives you help by listing the available commands. Read about netiquette before you post news.
- Press q to quit either of these programs.
Editors
To edit a file, type an editor name (pico, jove, emacs, or vi) and the file name at the prompt. We recommend pico. For more information on editors, see Word Processing in Unix.- pico: This is the editor pine uses to compose messages. The commands for Pico are at the bottom of the screen. Using pico -w keeps pico from adding line breaks as you type.
- emacs: A relatively simple text editor in Unix.
- vi: The text editor used by more Unix veterans than any other. Its interface can be difficult at first.
Internet
Reed's Unix machines are multi-user and networked. The following commands will help you to use these facilities.
- who tells you who is currently logged on at Reed and what time they logged in. There are several commands that can give you similar information: u, w, and finger.
- finger lets you see someone's finger information such as their real name. Not all sites allow finger access. Usage: finger <login@address>
- lynx is a text client for the World Wide Web. It reads all the text portions of an HTML document, but doesn't show pictures nor does it handle frames well. Usage: lynx <web page address>.
- ftp is a file transfer protocol program which lets you access archives of all sorts of information. See here about using ftp. Note: ftp is not necessarily secure. For a more secure version of ftp, see sftp below.
- Telnet allows you to login to a remote computer via a text interface. It is most popular for logging into Unix or Linux workstations, but MacOS X also has telnet recieving capabilities. Telnet is very insecure, and if at all possible you should use ssh over telnet. Usage: telnet <machine name>. Note: Telnet is not supported on the Reed machines. Use SSH instead.
- ssh lets you access remote sites. ssh should be used to move between the Unix machines on campus. To use, type ssh and the name/address of your intended destination. For more information, see SSH in Unix. Usage: ssh -l <login name> <machine name> or ssh <login name>@<machine name>.
Using SFTP in UNIX
SFTP can also be used through a UNIX command line. Information on all of the commands available in the UNIX SFTP program is available by typing help or help [command] while connected to SFTP.
To open sftp in a UNIX terminal:
- Type sftp [user]@oberon.reed.edu (where [user] is your login name) and hit return. This will open an sftp connection with your AFS space. (If you want to exchange files with a different server, use sftp [user]@[domain] to connect.)
- Enter your password at the prompt. Your cursor will not move and no text will appear while you are entering your password.
- Type put [filename.extension] to begin sending a file. If the file you want to send is not located in your Home Folder (and you haven't previously changed directories), you will have to tell the sftp program what path to follow in order to find your file ( put [directory]/[directory].../[filename.extension]). This can be done inTerminal either by manually describing the path, or by dragging and dropping the file onto the command line. After a few seconds, depending on the size of your file, you will see a message indicating that your file has arrived in your AFS space successfully.
- Type get [filename.extension] to begin downloading a file. If the file you want to get is not located in the main directory of your AFS space, you will have to tell the sftp program what path to follow in order to find your file ( get [directory]/[directory].../[filename.extension]). After a few seconds, depending on the size of the file, you will see a message indicating that your file has arrived in your Home Folder (on your local computer) successfully.
- To disconnect from the sftp program, type bye or exit and hit enter, or press control-D.
After sending files to your AFS space in this manner, you can manipulate them either by connecting to Oberon through ssh, or by graphically connecting to your AFS space over the network.
Getting Help
- man gives you a "manual page." This is the on line help for using Unix. These pages are not, however, the easiest thing to read and understand. Their most useful purpose is to list out all the options you can add to a command. For example, try man ls. Usage: man <commandname>.
- apropos <subject> will give you a list of possible commands on your listed subject.
Panicking in UNIX
- UNIX can be a scary place, since it is almost impossible to undo changes. If you get to a point where you are afraid you might do damage, hit ^C ( Control-C). A lot. It is the universal panic command — it will escape any program that is running and return you to the prompt.
Logging out of UNIX
- It's very important that you always log out completely and correctly. If you don't it's possible for people to get into your account and wreak all sorts of havoc in your name.
- At the prompt, enter the command logout or hit ^D (Control-D).
- If you are running Terminal from OS X, type logout again to close the window.
E-Mail in UNIX
You can send electronic mail (e-mail) to other users on campus or users at other locations around the world. To send e-mail to someone on or off campus, you must know their email address. Your UNIX e-mail address is <yourlogin>@reed.edu. To get started, type ipine at the % prompt. Notice that Pine always lists your command options along the bottom of the window.
Sending E-Mail
- To compose a letter to someone while in Pine, press c (for compose).
- After "To:" type in the email address.
- After "cc:" type in the login or address of someone who is to receive a carbon copy of your message. If you don't want a carbon copy sent just press Return.
- Type a short description of the subject of your letter after "Subject:"
- Now type your letter.
- When you have finished your letter press ^X to send it.
Note: Using a person's name rather than their UNIX login is the best way to address on-campus e-mail. For more information about addressing e-mail at Reed, see the Communication Handbook. When the message is sent to someone at Reed, the mail program checks the Domain Name Directory for the best place to put your message. Using names or part of names works for mailing lists, students, faculty and staff -- but alumni only have a UNIX login and thus cannot send or recieve email through Reed pine except to their Reed alumni forwarding account.
Reading E-Mail
To check your UNIX mail once you have opened Pine:
- Press i to see an index of the e-mail messages in your Inbox.
- You can move up and down the list of messages with the arrow keys pressing Return to tell pine that you'd like to read the message you've selected.
- After you've read the message you can tell pine what you'd like to do with the message you've just read: d to delete it, s to save it into a folder in your home directory, r to send a reply, or n to view the next message.
Navigating directories in UNIX
Recall from using MacOS or Windows the concepts of folders (or directories) and files. In those operating systems, you can double-click on folders until you find a file, and then double-click on the file to open it. UNIX follows this model with keyboard commands.
Tutorial: Navigating your home directory
- Log into oberon.
- At the prompt, enter the command pwd. This returns the current directory, probably /home/<login>, which is also called your home directory.
- At the prompt, enter the command ls -l. Each printed line represents either a directory or a file. A directory will have a d on the far left, a file will have a dash on the far left.
- Your home directory contains a directory named Private, where you can store files you don't want others to see. Type cd /home/<login>/Private to change the current directory to Private, where <login> is your UNIX login.
- Type ls -l to view the contents of Private (there might not be anything there). To return to your home directory, type cd ~.
Note: All directories can be referenced absolutely or relatively. The command cd /home/<login>/Private above was an absolute reference, which means the command can be entered regardless of the current directory. It would also be possible to use the command cd Private, which is a relative reference. However, this command will only work if your current directory is /home/<login>/. The tilde used above is an absolute reference to your home directory. Typing the command cd ~/Private is the same as cd /home/<login>/Private.
Word processing in UNIX
UNIX has two popular editors, pico and emacs. Pico is easier to use than emacs, though less sophisticated.
Creating a file in pico
Log into oberon. The current directory should be your home directory. At the prompt, type pico.
- Type as you would in a word processor. If you make a mistake, you can use the arrow keys and the Backspace button to correct it.
- Use ^O ( Control-O) to save the file. At the prompt, type in /tmp/newfile and hit Return. This creates a new file named newfile in the directory /tmp. The tmp directory is a communal directory where you have nearly unlimited, but temporary, hard drive space. The tmp directory gets deleted often, so you can never be sure if something you save there will still be there the next day.
- Use ^X ( Control-X) to quit pico.
Reading a file in pico
Log into oberon. The current directory should be your home directory. At the prompt, enter the command pico /tmp/newfile, or pico <filename>, in general.
Use the following command to read the file:
- Use the arrow keys to move the cursor.
- Use ^V ( Control-V) to scroll down one screen.
- Use ^Y ( Control-Y) to scroll up one screen.
- Use ^W ( Control-W) to search for a string of text. At the prompt, type in what you want to search for and hit Return.
- Use ^X ( Control-X) to quit pico.
Reading a file from the prompt
- Log into oberon. The current directory should be your home directory. At the prompt, enter the command more /tmp/newfile, where newfile is the name of the file you wish to read.
- Use the following commands to read the file:
- Press Return to scroll down one line.
- Press the space bar to scroll down one screen.
- Press B to scroll up one screen.
- To search for a string of text, type in /word, where word is what you want to search for. Hit Return.
- Press Q to quit and return to the prompt.
Removing a file

- Suppose you want to delete the file /tmp/newfile. Log into oberon.
- At the prompt, enter the command rm —i /tmp/newfile.
- If you are sure you want to delete the file, type y and hit Return. Otherwise, type n and hit Return. Beware: there is no "Recycling Bin" in UNIX; when files are deleted, there is a good chance they are gone for good.
Creating a directory
- Suppose you want to create a directory named mydir located in your home directory. Log into oberon.
- At the prompt, enter the command mkdir ~/mydir, or mkdir <directory> in general.
Removing a directory and its contents
- Suppose you want to delete the directory ~/mydir.
- At the prompt, enter the command rmdir ~/mydir.
- If you are sure you want to delete the directory, type y and hit Return. Otherwise, type n and hit Return. Beware: there is no "Recycling Bin" in UNIX; when directories are deleted, there is a good chance they and their contents are gone for good.
X Windows
You can learn how to use X Windows, a Graphical User Interface that runs on top of UNIX. Before using X Windows, you should be familiar with UNIX. This documentation assumes you are working at an IRC machine.
Running X Windows

- Click on the
icon on the dock. - Open the Communications folder.
- Double click on the X11 icon.
Running programs in X Windows
- Click on the Applications menu. You can run four programs:
- Terminal will open a UNIX terminal. This is not the same as the Terminal application that OS X comes with, because it allows you to run windowed UNIX programs.
- Oberon will open a UNIX terminal connected to Oberon, Reed’s home server. Again, this is not the same as connecting with the Terminal application that OS X comes with, because it allows you to run windowed UNIX programs, such as Mathematica.
- SPSS is a spreadsheet program, similar to Microsoft Excel.
- X Maple is a mathematics package, similar to Mathematica.
Exiting X Windows
- From the X11 menu, click on Quit X11.