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 am trying to launch a GUI from Ubuntu Terminal but after GUI starts I would like the command prompt to return to $ prompt. Currently what happens it seems to be waiting at the prompt till GUI collapses. If I force it to return to the prompt using CTRL+C, the GUI is terminated.

share|improve this question

1 Answer 1

If you add an ampersand to the end of the line, e.g.:

xclock &

The GUI process will be run as a background job from the perspective of the terminal. Output will still go to the terminal, so you may want to redirect that, but it won't wait for the GUI program to terminate before giving back a prompt.

You can suspend a process that you started in the foreground (i.e. normally) by hitting Ctrl-Z (in the terminal), and you should get a number in brackets and message saying "Stopped" and the command printed to the terminal, for example, for top:

[1]- Stopped top

If you then type bg and the number in brackets, it'll resume the program in the background. You can also type jobs to list background and suspended processes you've created from that shell.

To put a process back in the foreground, use fg and the number, instead.

Note that if you quit the shell, things you've put in the background will still get killed -- to avoid that, use the nohup command.

share|improve this answer
    
Thank you Aesin –  Deepak Kumar Vasudevan Mar 27 '13 at 1:47

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.