What are foreground and background processes in LINUX/UNIX? How do you run shell commands as foreground and background processes? Give an example for each.

What will be an ideal response?


A process whose standard input is attached to the keyboard is called a foreground process. While this process executes, you don’t get the shell prompt and, therefore, cannot run another command. A process that returns the shell prompt before it starts running is called a background process. You must terminate a command by an ampersand (&) in order to run it in the background. When a process runs in the background, it executes at a lower priority.
In the following session, the ls -l command is executed in the foreground and the find command is executed in the background. Note that the system displays the processs and job IDs for the background process before returning the shell prompt. The number in brackets (1) is the job ID and the second number (23985) is the process ID.
```
$ ls -l
[ output of the ls -l command ]
$ find / -name foo -print > foo.paths 2> /dev/null &
[ 1 ] 23985
$
```

Computer Science & Information Technology

You might also like to view...

Each of the following statements about a typical mobile social navigation app is true. Which most captures the essence of the application?

a. The app processes massive amounts of crowdsourced data—that is, the data that’s continuously supplied by users through their mobile GPS-based devices worldwide. b. The app uses speech synthesis to speak driving directions and alerts to you, and speech recognition to understand your spoken commands. c. The app uses your phone as a streaming Internet of Things (IoT) device. Each phone is a GPS sensor that continuously streams data over the Internet to the app. d. The app probably stores its routing information in a graph database. Such databases can efficiently calculate shortest routes.

Computer Science & Information Technology

A direct benefit of setting table relationships is that it can assist the database developer and the users when creating a single-table record source

Indicate whether the statement is true or false

Computer Science & Information Technology

What happens when a dialog box is closed using the Close button?

A) All changes made in the dialog box are applied. B) Only changes made in the dialog box are applied. C) All change that is made must be less than 20 dollars. D) All changes made in the dialog box are not applied.

Computer Science & Information Technology

First normal form refers to ____.

A. redundant data in an original table that is extracted, placed in a new table, and related to the first table B. derived fields that are removed C. a 2-dimensional table with rows and columns D. calculated fields that are removed

Computer Science & Information Technology