Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So lets say I'm executing a command on the CLI and it spawns a GUI and I forget the & at the end. Now I want my shell back, so I hit a ctrl-z but the GUI locks up! Is there any way to do a ctrl-z without locking up the GUI? I am using Linux with a bash shell, xorg and gnome. This is an Ubuntu system.

share|improve this question
add comment

2 Answers 2

up vote 7 down vote accepted

Use bg to put the command that you have stopped in the background.

share|improve this answer
    
It says "no such job" –  Rook Sep 28 '10 at 19:49
    
When you stop the job you will get something like [n]+ command stopped enter bg n to backgrounds the job –  Iain Sep 28 '10 at 20:02
    
Type 'jobs' to see currently running jobs. You should be able to pick the one you need from here. It'll probably be marked 'stopped'. –  wzzrd Sep 28 '10 at 20:18
    
and @wzzrd yeah but its not a job, its just a command like firefox. –  Rook Sep 29 '10 at 1:01
add comment

Check out GNU Screen. It is very useful for this type of thing as well as offering a bunch of other terminal multiplexing functionality that can be very nice.

share|improve this answer
    
I would call screen a lot of things, but a place to start GUI apps from and them (and it) leave them running until eternity wouldn't be one of them. Standard job control fits this job a lot better. –  wzzrd Sep 28 '10 at 20:33
    
And why is that? X11 forwarding works perfectly fine through screen. The OP wasn't asking how to suspend and resume his application, he really just wanted his shell back, which screen will give him. –  EEAA Sep 28 '10 at 20:42
add comment

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.