Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know that you can start a background job with Bash doing foo &. However, the best way I know to put a foreground job to the background is to do Ctrl+z to pause it then bg 1 to resume it in the background.

Is there a faster way? Some Ctrl+Something key combination I'm not aware of?

Thanks!

share|improve this question

2 Answers 2

up vote 6 down vote accepted

No, there isn't. The terminal reinterprets CtrlZ as SIGTSTP independently of bash putting the process into the background. See the susp option of stty as well as the signal(7) man page.

share|improve this answer

You could bind a keystroke to bg (no argument means the current job) then you could do

Ctrl-z Ctrl-Something

So it would be just two keystrokes. You wouldn't want to use bg 1 in case there are more than one job present.

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.