O'Reilly logo

Mac OS X in a Nutshell by Chris Stone, Chuck Toporek, Jason McIntosh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Process Management

Each command you invoke or program that you run from a Terminal window becomes a child of that terminal’s shell. The Terminal window can juggle many child processes at once, but only one at a time is foregrounded, writing its output (through the Unix standard output file handle) to the Terminal, and accepting keyboard input (via Unix standard input) from the user. Any other processes are either backgrounded, running but not displaying any interface or accepting input, or suspended, paused in the process of execution.

You can control the foregrounded application by sending it Unix signals via the keystrokes listed in Table 19-1. Programs usually respond to them as listed, though individual programs may interpret them differently. (The Emacs text editor, for example, ties a text-searching function to the Control-S keystroke.)

Table 19-1. Foreground process control keystrokes

Keystroke

Description

Control-C

Sends an interrupt signal, which usually causes the program to exit.

Control-D

Sends an end-of-file signal. If a program is accepting multiple lines of input from you, this signals that you’re finished providing it.

Control-Z

Suspends the foregrounded process and returns you to the command line.

Control-S

Suspends the foregrounded process, but keeps it in the foreground.

Control-Q

Resumes a suspended, foregrounded process.

Tip

Control-Q is a good keystroke to try if a Terminal window ceases to update or accept input for no obvious reason, while other ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required