Книга: Fedora™ Unleashed, 2008 edition
Background Processing
Background Processing
The shell enables you to start a command and then launch it into the background as a process by using an ampersand (&
) at the end of a command line. This technique is often used at the command line of an X terminal window to start a client and return to the command line. For example, to launch another terminal window using the xterm
client,
$ xterm &
[3] 1437
The numbers echoed back show a number (3
in this example), which is a job number, or reference number for a shell process, and a Process ID number, or PID (1437
in this example). You can kill the xterm
window session by using the shell's built-in kill
command, along with the job number like this:
$ kill %3
Or the process can be killed with the kill
command, along with the PID, like so:
$ kill 1437
Background processing can be used in shell scripts to start commands that take a long time, such as backups:
# tar -czf /backup/home.tgz /home &
Related Fedora and Linux Commands
You can use these commands and tools when using the shell or writing shell scripts:
? chsh
— Command used to change one's login shell
? kibitz
— Allows two-person interaction with a single shell
? mc
— A visual shell named the GNU Midnight Commander
? nano
— An easy-to-use text editor for the console
? system-config-users
— A graphical user-management utility that can be used to change one or more user login shells
? shar
— Command used to create shell archives
? vi
— The vi
(actually vim)
text editor
- Apache Multiprocessing Modules
- ACID Compliance in Transaction Processing to Protect Data Integrity
- 4.1. Background
- 5.3. Kernel Command Line Processing
- 10.5 Processing General Exceptions
- 11.5.1 Possible Processing Delays
- Using the BackgroundWorker Control
- 8.5.4 Processing and Printing Text
- Элемент xsl:processing-instruction
- Inside of the central processing unit (CPU)
- 12. They Called It LISP for a Reason: List Processing
- CeLog Event Tracking and Processing