Web server - 60 Part I . Linux First Steps The
60 Part I . Linux First Steps The plus sign (+) next to number 5 shows that it was most recently placed in the background. The minus sign (-) next to number 4 shows that it was placed in the background just before the most recent background job. Because job 1 requires terminal input, it cannot run in the background. As a result, it is Stopped until it is brought to the foreground again. To see the process ID for the background job, add a -l option to the jobs command. If you type ps, you can use the process ID to figure out which command is for a particular background job. Using Foreground and Background Commands Continuing with the example, you can bring any of the commands on the jobs list to the foreground. For example, to edit myfile again, type: $ fg %1 As a result, the vi command opens again, with all text as it was when you stopped the vi job. Before you put a text processor, word processor, or similar program in the background, make sure you save your file. It s easy to forget you have a program in the background and you will lose your data if you log out or the computer reboots later on. To refer to a background job (to cancel or bring it to the foreground), use a percent sign (%) followed by the job number. You can also use the following to refer to a background job: . % Refers to the most recent command put into the background (indicated by the plus sign when you type the jobs command). This action brings the command to the foreground. . %string Refers to a job where the command begins with a particular string of characters. The string must be unambiguous. (In other words, typing %vi when there are two vi commands in the background results in an error message.) . %?string Refers to a job where the command line contains a string at any point. The string must be unambiguous or the match will fail. . %– Refers to the previous job stopped before the one most recently stopped. If a command is stopped, you can start it running again in the background using the bg command. For example, take job 5 from the jobs list in the previous example: [5]+ Stopped nroff -man man4/* >/tmp/man4 Caution Tip
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision servlet hosting services