Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

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

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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