3

What is the faster way to launch any GUI program from the terminal without waiting for its completion and stdout / stderr logging? Now I'm using

"program_name >/dev/null 2>&1 &

but it's too long to type it every time. I'm new to the Linux world but I think that it's should resolved via small bash script, right?

3

You can create following script:

#!/bin/bash
"$@" >/dev/null 2>&1 &

Save as for example 'gui'. Next, allow to execute:

chmod +x gui

Copy to /usr/bin

# cp gui /usr/local/bin

Be happy of typing

gui program_name

!

  • You should use eval "$@" ..., this is safer than "$@" on its own (see stackoverflow.com/questions/11079342/…). Also /usr/local/bin` is a safer place than /usr/bin. – Graeme Feb 1 '14 at 15:58
  • If you use install instead of cp, this will add 755 permissions by default, no need for chmod. – Graeme Feb 1 '14 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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