7

I've started a long running and machine hog process. I've hit CTRL-Z to stop it. I've then put it in the background with bg. Oops, I should have restarted with fg so that I could easily stop and start it again. What is the easiest way to stop a process that was just put into the background?

3 Answers 3

12

Just run fg or fg %+. The job processing will keep track of the job and you can just tell it to go into the foreground again.

6

You don't need to stop it to put it into the foreground, just fg it.

5

As noted, fg = foreground.

You can also try jobs to see them. Then %N can be used with fg or kill e.g. fg %4

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .