0% found this document useful (0 votes)
79 views

Getting Started With Unix On A Uniform Access Computer: About This Document

Getting Started With Unix on a Uniform Access Computer is a starting point for beginning users of UW Uniform Access Unix computers. This document will help you if your interest in computing goes beyond information gathering and email, and you would like to learn the basics of the Unix operating system.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views

Getting Started With Unix On A Uniform Access Computer: About This Document

Getting Started With Unix on a Uniform Access Computer is a starting point for beginning users of UW Uniform Access Unix computers. This document will help you if your interest in computing goes beyond information gathering and email, and you would like to learn the basics of the Unix operating system.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Getting Started With Unix on a Uniform Access Computer

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix

Getting Started With Unix on a Uniform Access Computer


A starting point for beginning users of UW Uniform Access Unix computers. About This Document Introducing Unix Why Should I Learn Unix? Conventions Used for Commands in This Document Logging In and Out Finding Unix Information Online Help Unix Books Using Electronic Mail Send Email With Pine Check Your Email and Set Your Email Address Find Another User's Email Address Working With Files File Names Create a File With a Text Editor List Your Files Copy a File Change the Name of a File View a File Delete a File Print a File Working With Directories Directory Names Make a Directory List the Contents of a Directory Change the Name of a Directory
http://www.washington.edu/computing/unix/startdoc/ (1 of 3) [04/10/2002 10:05:18 AM]

Getting Started With Unix on a Uniform Access Computer

Delete a Directory Navigating Directories Determine Your Current Directory Pathnames Directory Abbreviations Move From One Directory to Another Protecting and Managing Your Account and Files File and Directory Permissions and Access Change Your Password Managing Your Account View Your Account Resources Working With the Unix Shell Control Codes Redirecting Input and Output Managing Your Processes List and Terminate Your Processes Run a Process in the Foreground or the Background Using Network Tools Computer Addresses Connect to a Different Computer Transfer Files Between Computers More Help Help by Email Help in Other C&C Publications Help Over the Phone Guidelines for Responsible Use Command Index
Unix Computing

http://www.washington.edu/computing/unix/startdoc/ (2 of 3) [04/10/2002 10:05:18 AM]

Getting Started With Unix on a Uniform Access Computer

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/ (3 of 3) [04/10/2002 10:05:18 AM]

About This Document

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

About This Document


This document will help you if your interest in computing goes beyond information gathering and email, and you would like to learn the basics of the Unix operating system. Before you continue, you need a UW NetID which gives you an account on a computer called Dante (if you are a student), or a computer called Homer (if you are faculty or staff). Both Dante and Homer are Unix computers. If you are interested in compiling Unix programs, using advanced applications, or complex programming, you will want an additional account on one of the following Unix computers:
q

Goodall--the student computer for advanced computation and statistical analysis Mead--the faculty and staff computer for advanced computation and statistical analysis

These computers are available to UW students, faculty, and staff with UW NetIDs. If you do not have your UW NetID, you can get one from the UW NetID and Computing Services Web page.

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/about.html [04/10/2002 10:06:26 AM]

Introducing Unix

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Introducing Unix
Included on this page:
q q q q q q

Why Should I Learn Unix? Conventions Used for Commands in This Document Logging In and Out Finding Unix Information Online Help Unix Books

Unix is the operating system of choice for thousands of government agencies, businesses, and universities, including the University of Washington. Its growing popularity stems from the fact that Unix combines many useful features:
q

q q

Unix is a multiuser environment that lets you simultaneously share the computer's resources with other users. Unix is a multitasking environment that lets you execute different programs simultaneously. Unix works well in networked computing, connecting you to the many computing and information services available on the network.

Why Should I Learn Unix?


Some people learn Unix as a class requirement, others learn Unix because it is the operating system on C&C computers, while others learn Unix to create and store files for World Wide Web pages. But most importantly, people learn Unix because it is a powerful tool. With a Unix Uniform Access computer, you can:
q q q q

Write, compile, and run computer programs Use statistical analysis software Correspond by email with colleagues Create and store files for Web pages

Conventions Used for Commands in This Document


http://www.washington.edu/computing/unix/startdoc/introduction.html (1 of 5) [04/10/2002 10:08:47 AM]

Introducing Unix

Italic indicates a variable that you must supply Bold indicates exactly what you type

Logging In and Out


Before you can use a Uniform Access computer, you must log in. To begin your session: 1. Connect to Mead or another Uniform Access Unix computer. 2. Enter your userid (UW NetID) at the login prompt. 3. Enter your password at the password prompt. A system prompt appears, and you can begin your session. To end your session, enter: logout

Finding Unix Information


If you are like most users, you occasionally have questions. At the University of Washington, the first place to look for help is online. You can also find books on Unix in the library or local book stores. If you need additional help, you can get it by email, in C&C publications, or over the phone. See More Help.

Online Help
Online help is a quick and convenient way to find information. Via your Uniform Access computer you can find three types of online help: help notes, manual pages, and Web pages.

Help Notes
With the help command, you can view information on a specific Unix topic. To display a list of available help notes, enter:

http://www.washington.edu/computing/unix/startdoc/introduction.html (2 of 5) [04/10/2002 10:08:47 AM]

Introducing Unix

help -l To read a help note, enter: help note This displays the help note you specify. Use <Spacebar> to scroll forward one page, <Return> to scroll forward one line, and the q key to quit.

To view the help note about electronic mail, enter: help email

You will find useful information in the commands and newuser help notes. To view these help notes, enter: help commands help newuser To print a help note, enter: help note | prt -q printer This sends the help note you specify to the C&C printer you specify.

Manual Pages
The Unix online manual pages or "man pages" provide a source of information. Man pages contain information about command usage, syntax, options, and bugs. Using the man command, you can display this information for almost every Unix command. To display the manual page for a command, at the system prompt, enter: man command This displays the manual page for the command you specify. Use <Spacebar> to scroll forward one page, <Return> to forward scroll one line, and q to quit.

http://www.washington.edu/computing/unix/startdoc/introduction.html (3 of 5) [04/10/2002 10:08:47 AM]

Introducing Unix

To print a man page, enter: man command | prt -q printer This sends the man page for the command you specify to the C&C printer you specify. Sometimes you do not know the name of the command you want. With the -k option, you can search for commands that relate to a keyword or topic. To search for a command by keyword use the -k option, enter: man -k keyword This searches the man pages for the keyword you specify and displays the command names that contain more information about the keyword.

To search the manual pages for a command that displays a calendar, enter: man -k calendar This finds several commands that relate to the keyword "calendar" including the cal command, which displays a calendar.

Web Pages
You can find Unix information under Computing and Networking on the UW home page http://www.washington.edu/computing There is information about Unix services and commands at http://www.washington.edu/computing/unix/ and there are answers to frequently asked questions (some concerning Unix) at http://www.washington.edu/computing/faqs/index.html To view a Web page via Lynx (a text-only Web browser): 1. At the system prompt (e.g., mead%), type lynx and press <Return>. When Lynx opens, you see a text-only version of the UW home page. 2. To enter a Web address, type G (Go). 3. At the prompt, type the address, for example, http://www.washington.edu/computing/unix/ or http://www.washington.edu/computing/faqs/ and press <Return>.
http://www.washington.edu/computing/unix/startdoc/introduction.html (4 of 5) [04/10/2002 10:08:47 AM]

Introducing Unix

To navigate Lynx:
q

q q q

Use your Up Arrow and Down Arrow keys to move between the numbered, underlined, or highlighted links on your screen. When you find a link you want to follow, press <Return> or the Right Arrow key to view that document. To go back to the previous document, press the Left Arrow key. See the bottom of the screen and the help text for additional commands. To quit Lynx, type Q (Quit) and then Y (Yes).

Unix Books
You can find dozens of books about Unix at libraries and bookstores. These books cover hundreds of additional Unix commands and concepts that can make Unix more powerful and easier to use.

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/introduction.html (5 of 5) [04/10/2002 10:08:47 AM]

Using Electronic Mail

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Using Electronic Mail


Included on this page:
q q q

Send Email With Pine Check Your Email and Set Your Email Address Find Another User's Email Address

Electronic mail (email) gives you the power to communicate with millions of computer users around the world.

Send Email With Pine


Pine is an easy-to-use email program that offers the following features:
q q q

Feedback giving information about each operation A command list at the bottom of each screen Context-sensitive help providing specific help for each task

To start the Pine email program, enter: pine This places you in Pine's Main Menu from which you can explore and learn more about Pine. If you get stuck, type the command (? or <Control>g) to access Pine's extensive help system.

Check Your Email and Set Your Email Address


The fmail (find my mail) command lets you check for email in all your Uniform Access accounts and route all your incoming email messages to one computer. To check for email messages on all your Uniform Access accounts, enter: fmail

http://www.washington.edu/computing/unix/startdoc/email.html (1 of 2) [04/10/2002 10:10:28 AM]

Using Electronic Mail

To route all your incoming messages to one computer, enter: fmail -to userid@computer This routes all the email you receive to the userid@computer that you specify. To find out more about routing your email to a single account, enter: help forward

Find Another User's Email Address


Electronic mail addresses cannot be reliably guessed, even if you know the person's name and organizational affiliation. Generally you need to have people tell you their email address, but if they are UW staff or faculty employees, you can look for it under their phone directory listing. On Uniform Access computers, the staffdir (staff directory) command is a convenient way to look up employees in the UW Faculty/Staff Directory. To look up a University employee's email address, enter: staffdir "lastname, firstname" You only need to use quotation marks around the person's name if their name contains spaces or punctuation symbols, such as O'Neil or Wright-Fair.

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/email.html (2 of 2) [04/10/2002 10:10:28 AM]

Working With Files

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Working With Files


Included on this page:
q q q q q q q q

File Names Create a File With a Text Editor List Your Files Copy a File Change the Name of a File View a File Delete a File Print a File

One of the most important skills in any computer system is knowing how to work with files. A file is a collection of characters that the operating system treats as a unit. Files can store any information you want to save. For example, files can contain text for letters and email messages, code for programs, or data for calculations. After you create a file, you can add material to it, delete material from it, or remove it from the system.

File Names
For every file you create, you must supply a name. In Unix, the following characters have special meaning, so you should avoid using them in file names: / \ " ` ' * | ! ? ~ $ < > &

File names may be between 1 and 255 characters long, but you will find that short, descriptive names are easiest to use. File names should not contain spaces. Instead of spaces, use underscores or periods to separate names made of multiple words, as follows: mail.Jan annual_report unix_tips

Also, Unix distinguishes between uppercase and lowercase letters. For example, Unix would treat these as three different files:

http://www.washington.edu/computing/unix/startdoc/files.html (1 of 5) [04/10/2002 10:11:12 AM]

Working With Files

project1

Project1

PROJECT1

Create a File With a Text Editor


Text editors let you enter, edit, and re-arrange text in files. Uniform Access computers support several text editors including Pico , vi, and others. If you are a beginning Unix user, you might prefer Pico to vi for the following reasons:
q q

Pico is easier to learn and use. Pico contains online help text and lists the most commonly used commands at the bottom of each screen. Pico is designed for worry-free exploration.

To create a new file using the Pico text editor, enter: pico file Note: the p in the pico command is lowercase. This starts the Pico text editor and opens a blank file. Pico assigns to that file the name you specify. Use your keyboard to add text to the file. To save a file and exit the Pico text editor: 1. Press <Control>x This means hold down the Control key, while you press the x key. 2. In response to the question: Save before leaving (y/n)? Type y 3. In response to the prompt: Filename to write: Press <Return> or enter a new name. To re-open and edit a file with the Pico text editor, enter: pico file Where file is the name of the file you want to edit.

http://www.washington.edu/computing/unix/startdoc/files.html (2 of 5) [04/10/2002 10:11:12 AM]

Working With Files

To create a file named sport.quote, enter: pico sport.quote This starts the Pico text editor with the file sport.quote. Add to this file the following lines of text: It ain't over till it's over. We're taking this season one game at a time. Football players make football plays. Turn out the lights, the party's over. When you finish typing, save and exit sport.quote using the three steps that precede this example. To re-open and edit sport.quote, enter: pico sport.quote

List Your Files


To list the files in your current directory, use the ls (list) command. At the system prompt (e.g., mead%), enter: ls Your list might resemble the following: mail murphy.law phone.dir sport.quote

For more on the ls command, see List the Contents of a Directory

Copy a File
To copy a file, use the cp (copy) command. Enter: cp file1 file2

This creates a copy of file1 and names it file2.


http://www.washington.edu/computing/unix/startdoc/files.html (3 of 5) [04/10/2002 10:11:12 AM]

Working With Files

To copy a file to a different directory, enter: cp file directory

This creates a copy of the file you specify in directory the you specify. For more information on directories, see Working With Directories.

Change the Name of a File


To change the name of a file, use the mv (move) command. Enter: mv file1 file2

This changes the name of file1 to file2.

View a File
To view a file, use the more command. Enter: more file This starts the more program, which lets you view the file you specify one screen at a time. Use <Spacebar> to scroll forward one screen, <Return> to scroll forward one line, and q to quit the more program. To search for a word in the file, type / followed by the word and then press <Return>.

Delete a File
To delete a file, use the rm (remove) command. Enter: rm file This permanently removes the file you specify. A safe way to give the rm command is with the -i option. With the -i option, you are prompted before a file is permanently removed. To require a prompt before a file is deleted, enter: rm -i file

http://www.washington.edu/computing/unix/startdoc/files.html (4 of 5) [04/10/2002 10:11:12 AM]

Working With Files

In response to the prompt, enter y to remove the file or n to keep the file.

Print a File
Printing a file involves sending it to a printer capable of translating the file's contents into an image on paper. Files can contain text, graphic images, or both. This section covers files containing only plain text.

Print a File to Your Desktop Printer


To print to your desktop printer, you can use a file transfer program (such as FTP, Secure Fetch, or SSH) to move the file to the disk storage system of your desktop computer. After transferring the file, use a desktop program (e.g., a word processor) to print the file. One advantage of this method is that you can make formatting changes to the file before printing. A second method for printing from a Uniform Access computer to a desktop printer is with the ansiprint command. This command will only work for selected types of equipment and software. PCs and Macs should work if they run an up to date terminal session program such as Tera Term Pro, or Better Telnet. To print a file to your desktop printer, enter: ansiprint file

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/files.html (5 of 5) [04/10/2002 10:11:12 AM]

Working With Directories

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Working With Directories


Included on this page:
q q q q q q q q q q

Directory Names Make a Directory List the Contents of a Directory Change the Name of a Directory Delete a Directory Navigating Directories Determine Your Current Directory Pathnames Directory Abbreviations Move From One Directory to Another

You will probably find that you eventually will accumulate dozens (or even hundreds!) of files. Grouping them into different directories makes them easy to keep track of. For example, a directory named Receipts might contain monthly receipt figures with files named jan, feb, and mar. You may want to create directories and add new files to them, or delete existing files or directories you no longer need. Your home directory is assigned to you when you create your Uniform Access account. Whenever you log in to your account, your session begins in your home directory. Your home directory is named with your userid name, the name you use to log in. You control your home directory--you can set permissions that determine who can read, change, and execute your files. You also determine the structure of your home directory--you can create any other directories, or files you want within your home directory. Figure 1: A Home Directory With Files and Directories

http://www.washington.edu/computing/unix/startdoc/directories.html (1 of 7) [04/10/2002 10:11:50 AM]

Working With Directories

Directory Names
Use the same rules for naming directories as you do for naming files (see File Names).

Make a Directory
To make a directory, use the mkdir (make directory) command. Enter: mkdir directory This will make a directory with the name you specify

To make a directory for your chemistry papers and assignments, enter: mkdir Chemistry This makes the directory named Chemistry. If you begin your directory names with a capital letter, they are easier to distinguish from your file names.

List the Contents of a Directory


To view the file and directory names in your directory, use the ls (list) command. Enter:
http://www.washington.edu/computing/unix/startdoc/directories.html (2 of 7) [04/10/2002 10:11:50 AM]

Working With Directories

ls To view the names of the files and directories in a different directory, enter: ls directory The ls command takes several command options that let you display additional file and directory information. The following list summarizes some of the most popular options: ls -l Displays files in long format (see File and Directory Permissions and Access) ls -t Displays sorted by time of last modification ls -r Displays in reverse order ls -F Displays contents and indicates file type You can also use the ls command with several options at once: ls -lFt directory

Change the Name of a Directory


To change the name of a directory, use the mv (move) command. Enter: mv directory1 directory2

This changes the name of directory1 to directory2.

Delete a Directory
You can use the rmdir (remove directory) command to delete a directory. Before you can delete a directory, it must be empty of all files (see Delete a File). To delete a directory, enter: rmdir directory

http://www.washington.edu/computing/unix/startdoc/directories.html (3 of 7) [04/10/2002 10:11:50 AM]

Working With Directories

Navigating Directories
The following section shows you how to move between directories. The directory you are working in is called your current directory. When you log in, your current directory is your home directory. When you move to another directory, that directory becomes your current directory.

Determine Your Current Directory


If you forget the name of your current directory, you can use the pwd (print working directory) command. To display the name of your current directory, enter: pwd For a user with the userid "jjaudubon," who is working in their home directory, the pwd command display would look something like this: /ua19/S0/jjaudubon

Pathnames
A pathname identifies the exact location of each file and directory in the Unix file system. Pathnames are described in two ways: absolute and relative. Figure 2: A Unix Directory Structure

http://www.washington.edu/computing/unix/startdoc/directories.html (4 of 7) [04/10/2002 10:11:50 AM]

Working With Directories

Absolute Pathname
In the Unix file system, the uppermost directory is known as the root directory (see Figure 2). All other directories are located under the root directory. An absolute pathname starts with a slash (/) to represent the root directory, then traces a path through the file system to a specific file or directory. You can specify any file or directory in the file system by means of its absolute pathname. Because the absolute pathname starts at the root directory, it always begins with a /. All the names in a pathname are also separated by a /. Do not be confused by the dual meaning of the / character. It is both the symbol of the root directory and a separator between names. In the Unix file system, it is possible for more than one user to have a file called jan. Two files with the same name, for example jan in Figure 2, are distinguished by their absolute pathnames: /ua19/S1/User1/Receipts/jan /ua19/S1/User2/Vacations/jan

Relative Pathname
A relative pathname shows the route to any file or directory from your current directory. Both User1 and User2 can access their files named jan from their home directories using relative
http://www.washington.edu/computing/unix/startdoc/directories.html (5 of 7) [04/10/2002 10:11:50 AM]

Working With Directories

pathnames: Receipts/jan Vacations/jan

Directory Abbreviations
You can use directory abbreviations to shorten the pathnames of a complex directory structure. The following list shows some useful abbreviations: ~ .. . Your home directory Parent directory-the directory just above your current directory Current directory

To copy a file from your home directory to your current directory, enter: cp ~/file . This command uses the abbreviations for your home directory (~) and your current directory (.) to copy the file you specify.

Move From One Directory to Another


The cd (change directory) command lets you move from your current directory to another directory, which then becomes your current directory. When you give the cd command you must specify the absolute or relative pathname of the directory to which you want to move. To move to another directory, enter: cd directory This moves you from your current directory to the directory you specify. To move to your home directory from anywhere in the file system, enter: cd

http://www.washington.edu/computing/unix/startdoc/directories.html (6 of 7) [04/10/2002 10:11:50 AM]

Working With Directories

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/directories.html (7 of 7) [04/10/2002 10:11:50 AM]

Protecting Your Account and Files

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Protecting Your Account and Files


Included on this page:
q q q q

File and Directory Permissions and Access Change Your Password Managing Your Account View Your Account Resources

Like a house or automobile, Uniform Access computer accounts must be protected. If you are not careful, your account and files can be broken into, vandalized, or even stolen by unlawful computer users.

File and Directory Permissions and Access


You decide who can use your files and directories by setting permissions. Each file and directory has three types of permissions: 1. Read (r) gives permission to view, print, and copy. 2. Write (w) gives permission to edit, delete, and save. 3. Execute (x) gives permission to run an executable file, such as a program. In the case of a directory, (x) allows you to change to that directory. You set these permissions for three classes of users: 1. You, the owner of the file. 2. Your group. 3. All others. You can view the permissions of your files using the ls -l command. The ls -l command lists the contents of your directory in long format. For example: drwxr-xr-x 2 userid 512 Sep 14 08:24 Sales drwxr-xr-x 2 userid 512 Sep 14 08:24 Receipts -rw-r--r-- 1 userid 0 Sep 14 08:24 budget

http://www.washington.edu/computing/unix/startdoc/protecting.html (1 of 5) [04/10/2002 10:12:24 AM]

Protecting Your Account and Files

Figure 3: Permission Settings for a File and a Directory

The first character indicates file type: a - (hyphen) indicates an ordinary file, and a d indicates a directory. Unix considers the next nine characters as three sets of three. The first set of three determines the owner's permissions, the second set determines the group's permissions, and the third set determines all others' permissions. If you wish to change the permissions of a file or directory, you can use the chmod (change mode) command. The chmod command uses a number code. Each permission setting corresponds to a number between 0 and 7. For each file or directory, you assign three numbers between 0 and 7.
q q

The first number gives the permissions for the owner. The second number gives the permissions for the owner's group. Note: On Uniform Access accounts the group permission has no meaning because all users belong to the same group and no other groups can be formed. The third number gives the permissions for all others.

The following shows how the permissions correspond to each number code: 7 6 5 4 3 2 1 0 Read, Write, and Execute Read and Write only Read and Execute only Read only Write and Execute only Write only Execute only No Permissions (rwx) (rw-) (r-x) (r--) (-wx) (-w-) (--x) (---)

To change the permissions of a file, enter:

http://www.washington.edu/computing/unix/startdoc/protecting.html (2 of 5) [04/10/2002 10:12:24 AM]

Protecting Your Account and Files

chmod code

file

Where code is the three-digit number corresponding to the permissions you desire. Note: When you set permissions for a file that you want others to use, you must make sure that your directories along the pathname leading to the file also have the appropriate permissions.

To set the permissions of a file so other users cannot read or write to it, enter: chmod 600 file To see the new permissions for the file you specify, use the ls -l file commmand. The permissions should now be -rw------

Change Your Password


You can help keep your account safe by choosing a hard-to-guess password. To change your password, enter: passwd This initiates a program that first verifies your old password, then lets you type a new password, and finally asks you to retype your new password. Keep these items in mind when choosing a password:
q

Do not use words from the dictionary; instead, create a unique password by mixing uppercase letters, lowercase letters, numerals, and punctuation (e.g., i8myDog, eyeCu!, Jo?hNny). Do not write your userid and password next to each other, or tell them to others. Doing either could give people access to your account and files, and they could then do things on your behalf such as send email. Change your password frequently (at least once a month). You are required to change it every 120 days.

Managing Your Account


When you create an account on a Uniform Access computer, you are given an allotment of computer

http://www.washington.edu/computing/unix/startdoc/protecting.html (3 of 5) [04/10/2002 10:12:24 AM]

Protecting Your Account and Files

resources. These resources include:


q q q

Disk space-the amount of space your files take up on the computer. Connect time-the amount of time you are logged into the system. Central processing unit (CPU) time-the amount of time the computer must spend to execute your commands.

View Your Account Resources


To view your account's resources, and your use of those resources, enter: assets Figure 4: Assets Command Display

This shows both your threshold, the amount you are allotted, and your usage averaged over a five-day period. When your CPU usage goes beyond your threshold amount, the computer will assign your commands a lower priority, and they will take longer to complete. If you exceed your disk space limit, you will be warned and given some time to clean up your account. The du (disk usage) command is useful for viewing the amount of disk space, measured in kilobytes, each of your directories occupies. To view your account's disk usage, enter: du

http://www.washington.edu/computing/unix/startdoc/protecting.html (4 of 5) [04/10/2002 10:12:24 AM]

Protecting Your Account and Files

For more information about accounts, enter: help accounts If you are like other Uniform Access users, you may eventually use up your account's resources. Before you panic, try some of the following techniques:
q q q

Remove the files you no longer need such as old email, practice files. Check for a file named core and remove it. Compress large files with the compress command (see the Unix Quick Reference or enter man compress for more information).

For more information about disk space and use, enter: help diskuse

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/protecting.html (5 of 5) [04/10/2002 10:12:24 AM]

Working With the Unix Shell

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Working With the Unix Shell


Included on this page:
q q q q q

Control Codes Redirecting Input and Output Managing Your Processes List and Terminate Your Processes Run a Process in the Foreground or the Background

Unix is an operating system that controls the computer and your interaction with it. The shell lets you communicate with Unix by providing you with the system prompt. When you see a system prompt, it means the shell is ready for a command. Once you enter a command, the shell interprets it and is responsible for its execution. Up until now, each time you have entered a command, you have been using the shell. The shell also controls your environment and contains a programming language. Most Unix computers, including Uniform Access computers, run several shells, allowing you to choose the one you prefer. By default, on Uniform Access computers, you start in the C-shell.

Control Codes
The C-shell offers a number of special commands known as control codes. Control codes define commands specific to the operating system. To issue a control code, hold down <Control> and press the corresponding letter key. The following summarizes some of the most commonly used control codes: <Control>d <Control>c <Control>z <Control>u Signals the end of a file you are entering from the terminal if typed at the beginning of a line or if typed twice elsewhere in a line. Cancels a command or interrupts a running program. Suspends a process or job but does not terminate it: use fg to restart suspended process or job. Clears the command line.

http://www.washington.edu/computing/unix/startdoc/shell.html (1 of 5) [04/10/2002 10:13:11 AM]

Working With the Unix Shell

Redirecting Input and Output


Most Unix commands receive input from what is called "standard input" and send output to "standard output". Typically, standard input is from the keyboard, and standard output is displayed to the screen. The routing of standard input and output can be changed by using redirection and piping. Redirection and piping let you connect commands together.

Use a File as Input For a Command


You can use the less-than symbol (<) to use a file as input for a command. To redirect a file as input for a command, enter: command < file

Create a File by Redirecting Output


Output of a command can be redirected into a file by using the greater-than symbol (>). You can then use this file as you would any other file. To redirect command output to a file, enter: command > file Note: If you specify a file that already exists, its contents will be overwritten.

You can use output redirect to save information such as a help note into a file. To save the email help note as a file, enter: help email > email.info This creates the file named email.info and places the text from the email help note into this file, rather than displaying it on the screen.

Add to a File by Redirecting Output


Output can also be appended to the end of an existing file by using two greater-than symbols (>>).
http://www.washington.edu/computing/unix/startdoc/shell.html (2 of 5) [04/10/2002 10:13:11 AM]

Working With the Unix Shell

To append command output to an existing file, enter: command >> file

Chaining Commands
With the pipe symbol ( | ) you can have the output of one command fed (piped) to the input of another command (the | is usually found above the \ key). To chain two commands, enter: command1 | command2

The w command displays a list of who is on the system. This list is usually very long, and it scrolls by quickly. to view the output of the w command one screen at a time, you can link it to the more program. To show who is on the system one screen at a time, enter: w | more For additional information about more see View a File.

Managing Your Processes


Each time you issue a command, you start a process (when you logged in, you started your first process).

List and Terminate Your Processes


To display a complete list of your current processes and their corresponding process identification numbers (PIDs), use the ps (process status) command along with the ux options. Enter: ps ux Any of your processes can be stopped with the kill command. To kill a process, enter:
http://www.washington.edu/computing/unix/startdoc/shell.html (3 of 5) [04/10/2002 10:13:11 AM]

Working With the Unix Shell

kill pid Where pid is the number of the process you want to stop. Type ps again to verify that the process has been killed. Some processes require a stronger form of the kill command. When the kill command alone does not terminate a process, try using the kill command with the -9 option. To kill a process using the -9 option, enter: kill -9 pid

Run a Process in the Foreground or the Background


You can run a process in two ways: as a foreground process or as a background process. When you run a process in the foreground, you must wait for the process to complete before you can run another one (all the commands you have issued to this point have been foreground processes). In the background, however, you can run several processes without waiting for them to complete. The background is a very useful place to run a process that takes a long time to finish. When a process needs user input, it will interrupt you regardless of where it is running; therefore, you should avoid putting processes that require user interaction into the background. To start a process in the background type an & after the command. Enter: command & This starts the process, from the command you specify, in the background. To suspend a foreground process and place it in the background, use the following steps: 1. Press <Control>z 2. Enter bg To bring this background process to the foreground again, enter: fg Note: the fg command is useful to remember because occasionally you might type <Control>z accidentally or, if you connect with a modem, noise in the phone lines might magically suspend a process. Just enter fg to restart such a suspended process.

http://www.washington.edu/computing/unix/startdoc/shell.html (4 of 5) [04/10/2002 10:13:11 AM]

Working With the Unix Shell

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/shell.html (5 of 5) [04/10/2002 10:13:11 AM]

Using Network Tools

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Using Network Tools


Included on this page:
q q q

Computer Addresses Connect to a Different Computer Transfer Files Between Computers

Computers at the University of Washington are connected to a computer network known as the Internet. The Internet connects millions of computer users across the country and around the world. All Uniform Access computers are linked to the Internet, giving you the power to communicate with people worldwide and to access the resources of other Internet computers.

Computer Addresses
Every computer on the Internet has a unique address. Before you can connect and interact with a particular computer, you must know its address. The first part of an address represents the computer's name called the host name. This is followed by a hierarchical naming structure know as the domain name. mead.u.washington.edu nri.reston.va.us (host.subdomain.subdomain.domain) (host.subdomain.subdomain.domain)

Connect to a Different Computer


Once you know a computer's address, you can connect to that remote computer with communications software. On Uniform Access computers, you can use ssh to connect to University computers. For more information on ssh, enter: man ssh To connect to a remote computer, enter:

http://www.washington.edu/computing/unix/startdoc/tools.html (1 of 2) [04/10/2002 10:14:20 AM]

Using Network Tools

ssh address When you connect to a remote computer with telnet, you must then log in to that computer (see Logging In and Out). Most computers require you to have an account before you can log in. Type quit to exit ssh.

Transfer Files Between Computers


You can also connect to a remote computer with "sftp" (Secure File Transfer Protocol). Sftp lets you quickly transfer files between computers connected to the Internet. If you have an account on several Uniform Access computers, you can use Sftp to transfer files between them. For more information on sftp, enter: man sftp To connect to a different computer, enter: sftp address This connects you to the computer address that you specify. Type quit to exit FTP and return to the system prompt.

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/tools.html (2 of 2) [04/10/2002 10:14:20 AM]

More Help

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

More Help
Included on this page:
q q q

Help by Email Help Online Help Over the Phone

If you have any questions about the information in this document, or if you would like to know more about computing at the University of Washington, you should start by looking online (see Online Help). If you need additional help, you can get it via email, other C&C publications, or the telephone.

Help by Email
Specific questions can be sent to [email protected]. This email is read by C&C consultants who either answer the question or find someone who can. Answers are returned to you via email as soon as possible. Email sent to [email protected] is monitored during the day, seven days a week (see Using Electronic Mail).

Help Online
q

Unix Computing and Batch Processing on Uniform Access Computers Basic and advanced Unix documents and Uniform Access accounts and rates. Look on the Web at http://www.washington.edu/computing/unix/ The UW Computer Training Catalog A list of classes offered by C&C for all faculty, staff, and students. The classes range in skill level from basic to advanced and cover many topics including the Unix operating system. There are classes that will be of interest to you whether you use a PC, workstation, or mainframe computer. Some classes are free, while others are offered for a fee. Look on the Web at http://www.washington.edu/computing/catalog/ Windows on Computing A C&C newsletter that discusses UW computing policies, new or changed services, and particular

http://www.washington.edu/computing/unix/startdoc/help.html (1 of 2) [04/10/2002 10:14:41 AM]

More Help

computing applications used in UW departments. Look on the Web at http://www.washington.edu/computing/windows/


q

Unix Quick Reference Commonly used commands and options on UA Unix computers. Look on the Web at http://www.washington.edu/computing/unix/unixqr.html Getting Started With Email Using Pine An introduction to reading, sending, and managing electronic messages. Look on the Web at http://www.washington.edu/computing/email/pinedoc/

Help Over the Phone


If you have an urgent problem, you can call Computing & Communications Information at 206-5435970. They will answer your question, or give you the phone number of the appropriate help source.

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/help.html (2 of 2) [04/10/2002 10:14:41 AM]

Guidelines for Responsible Use

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Guidelines for Responsible Use


Everyone within the UW community who uses a computer, whether it is a PC, a workstation, or a Uniform Access computer, has the responsibility to use computer resources in an ethical and legal manner. This means that you agree to abide by the following conditions:
q q

q q q

The integrity of the systems must be respected. Privacy of other users must not be intruded upon at any time. (For example, do not send email to someone who has requested that you not do so.) The rules and regulations governing the use of UW facilities and equipment must be respected. No one will obtain unauthorized access to other users' accounts and files. The intended use of all computer accounts, for University research, instruction, and administrative purposes, must be respected.

For more information about guidelines for responsible use, look at Knowing the Rules on the Computing and Networking home page (http://www.washington.edu/computing/rules.html) or in UWIN under Computing and Networking > Getting Started > Knowing the Rules. In summary, when you are using computers at the UW, University policy prohibits account theft, file theft, violations of informational privacy, and/or penetration or harm to operating systems. If abuse of computer systems occurs, those responsible for such abuse will be held legally accountable.

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/guidelines.html [04/10/2002 10:15:10 AM]

Command Index

Search | Directories | Reference Tools UW Home

> Computing and Networking > Unix > Unix Basics

Command Index
The links below will connect you with the part of the document which explains the command. ansiprint assets bg cd chmod cp du fg fmail fmail -to ftp help help -l kill kill -9 logout ls ls -F ls -l ls -r ls -t lynx man man -k mkdir more mv pico pine prt -printers prt -q ps ux pwd rm rm -i rmdir staffdir telnet

A more complete list of Unix commands can be found in the Unix Quick Reference .

Computing & Communications [email protected] Modified: January 23, 2002

http://www.washington.edu/computing/unix/startdoc/commands.html [04/10/2002 10:15:36 AM]

You might also like