Job control

From Wikipedia, the free encyclopedia

On operating systems that support executing multiple processes in parallel or in series (batch processing), job control refers to the orchestration of multiple batch jobs.

Contents

On mainframes, job control is carried out by a job scheduler.

When using Unix or related operating systems via a terminal, a user will initially only have a single process running, their login shell. Most tasks (directory listing, editing files, etc.) can easily be accomplished by letting the program take control of the terminal and returning control to the shell when the program exits; however, sometimes the user will wish to carry out a lengthy task in the background while using the terminal for another purpose. Job control is a facility developed to make this possible, by allowing the user to start programs in the background, send programs into the background, bring background programs into the foreground, and start and stop running programs. Programs under the influence of a job control facility are referred to as jobs.

Job control was first implemented in the C shell, making use of features of the 4.1BSD kernel. The facility was then incorporated into the Bourne shell, and exists in most modern Unix shells.

  • Typically, the shell keeps a list of jobs in a job table. A job consists of all the members of a pipeline.
  • A program can be started as a background task by appending &[1] to the command line; its output is directed to the terminal (potentially interleaved with other programs' output) but it cannot read from the terminal input.
  • A task running in the foreground can be stopped by typing the suspend character (Ctrl+Z); this sends SIGTSTP to the process and returns control to the shell.
  • The process can be resumed as a background job with the bg builtin or as the foreground job with fg; in either case the shell redirects I/O appropriately and sends SIGCONT to the process.
  • jobs will list the background jobs existing in the job table, along with their job number and job state (stopped or running).
  • The kill builtin (not /bin/kill) can signal processes by job number as well as by process ID.
  • disown can be used to remove jobs from the job table, converting them from jobs into daemons so that they continue executing when the user logs out.

  1. ^ This section uses Bash syntax; other shells offer similar functionality under other names.


Advanced Search
Included Web Search Engines


Safe Search

close

Top Matching Results

Occasionally Search.com will highlight specialized results that are based on the context of your query. Examples of specialized results include specific links to news, images, or video.

Top Matching Results may highlight information from other Search.com pages, content from the CNET Network of sites, or third party content. The listings are based purely on relevance. Search.com does not receive payment for listings in this section but our partners that provide this data may get paid for listing these products.

Sponsored Links

This section contains paid listings which have been purchased by companies that want to have their sites appear for specific search terms and related content. These listings are administered, sorted and maintained by a third party and are not endorsed by Search.com.

Search Results

Search.com sends your search query to several search engines at one time and integrates the results into one list which has been sorted by relevance using Search.com's proprietary algorithm. You can customize the list of search engines included in your metasearch from the preferences.

The search engines that are used in your metasearch may allow companies to pay to have their Web sites included within the results. To view the Paid Inclusion policy for a specific search engine, please visit their Web site. Search.com does not accept payment or share revenue with any search engine partner for listings in this section.