7

I know that to launch an application and still keep working on the terminal, & is put in the end of command (like emacs&)
But some commands still keep printing on the terminal, like this

So how to really keep the command quiet on the terminal?

0

1 Answer 1

14

What you are seeing are the errors, being printed to stderr (standard error). By default stderr is printed to the terminal used to start the program. We can change this easily though, to point to /dev/null, which is basically a black hole. It's a device that doesn't do anything, so when you write to it, nothing actually happens. The following command will redirect ALL output (stderr and stdout) to /dev/null and then give you back your terminal.

firefox &> /dev/null &

The &> is the redirector, /dev/null is where we are redirecting to, and the last & means to "background" the process, so we can have our terminal back.

On a side note, if you ever want to bring a backgrounded program back to the terminal, you can use the fg (short for foreground) command to bring it back. And if you type the combination of keys Ctrl+Z you will be able to "suspend" the process, then you can type bg to send it back to background.

1
  • Good Explanation ..........
    – One Zero
    Jun 14, 2012 at 16:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .