Which of the following commands moves and resumes in the background the last stopped shell job?
Click on the arrows to vote for the correct answer
A. B. C. D.B
The correct answer is C. fg.
The "fg" command stands for "foreground" and is used to bring a stopped or background job to the foreground. It can be used to move a stopped job to the foreground or to resume a background job.
To use "fg" to move the last stopped shell job to the foreground, simply type "fg" followed by the job number. The job number can be obtained by running the "jobs" command, which will display a list of currently running or stopped jobs along with their job numbers.
For example, let's say that you have a job running in the background and you want to bring it to the foreground. You can use the "jobs" command to find the job number, and then use the "fg" command to bring it to the foreground:
shell$ sleep 1000 & [1] 1234 $ jobs [1]+ Stopped sleep 1000 $ fg %1
In this example, the "sleep 1000" command is run in the background, and the job is assigned the job number 1. The "jobs" command is then used to display information about the running jobs, which includes the job number and the status of the job ("Stopped" in this case). Finally, the "fg %1" command is used to bring the job to the foreground. The "%1" notation is used to specify the job number.
Note that if there is only one job running or stopped, you can use the shorthand "fg" command without specifying a job number:
shell$ fg
This will bring the last stopped or background job to the foreground.