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?


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.


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


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.