Chris Snow Chris Snow - 1 year ago 60
Linux Question

execute a gui application from the command line and send it to the background

Is there a command line utility that I can use for executing X based applications that will detach my applications from the terminal so they aren't closed if the terminal is closed?

I guess such a app could be called something like

if it existed.

I have tried
, but it seems that you have to provide a socket file which is a bit clunky to type. I have also tried
, but found that also to be a bit clunky to type by the time std out and err are redirected to

I guess I'm looking for a simple program that will do something similar to this:


nohup $1 > /dev/null 2>&1 &

Answer Source

Yes, there is a way to do it: first you need to run your GUI app and send it to background, then you (probably) want to detach it from Bash task management. For example if I wanted to run gedit this way:

gedit &
disown %1

After that you can close your terminal window and gedit will not be killed. Enjoy!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download