Services and User Management
A user's shell shows these jobs: [1] Running ./sync.sh &, [2]- Stopped vim notes.txt, and [3]+ Stopped ./report.sh. The user wants to resume editing in the stopped vim session in the foreground. Which command does this?
Show the answer
Correct answerD. fg %2
fg %2 brings job 2, the stopped vim session, to the foreground and resumes it. A plain fg acts on the current job marked +, which is report.sh, not vim. bg %2 would resume vim in the background, where it would just stop again waiting for terminal input.