UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 1.25 Access to Directories Chapter 1
Introduction
Next: 1.27 How Background Processing Works
 

1.26 What a Multiuser System Can Do for You

Even if you are the only user, a multiuser system can do a lot of things for you that a simpler operating system can't. For one thing, you can run several programs at the same time: you don't have to wait for one program to finish before you start the next. Even if you don't have a fancy windowing terminal or a workstation (1.31), you can still run jobs in the background (1.27). Instead of waiting until the program finishes, UNIX lets you give another command immediately. It then runs both programs at the same time, along with the other programs that are running. You are time sharing with yourself.

Running a job in the background is a good way to take advantage of the time the system spends running long jobs. For example, assume that you have just gotten a huge C program from a friend and want to compile and run it (52.8). But you don't want to sit while you're waiting for the compiler to do its work; you'd like to write a letter to your friend. So you can start the compilation in the background and start your editing session in the foreground.

% cc -O bigprogram.c &
[1] 2236
% vi letter.txt

The & means "run the job in the background." The next line is information the shell prints out to make it easier for you to work with your background processes. [1] is a job number, which you'll only see on shells with job control (12.1). The 2236 is a process ID (38.3).

- ML


Previous: 1.25 Access to Directories UNIX Power ToolsNext: 1.27 How Background Processing Works
1.25 Access to Directories Book Index1.27 How Background Processing Works

The UNIX CD Bookshelf NavigationThe UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System