Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

When I launch an application from terminal related to the window system, for example gnome or kde, then usually these applications send all sorts of junk messages in my terminal. How do I make these applications shut up?

For example if I type:

 okular somepdf.pdf & 

a window which shows the pdf file pops up and I can read the pdf next to my terminal, and when I am done I close.

Here is a typical example:

:~$ cd Documents
:~/Documents$ okular equi.dvi &
[1] 5823

and when I close it sends this junk to the terminal:

:~/Documents$ okular(5823)/kdeui (kdelibs) KXMLGUIClient::~KXMLGUIClient: 0x2322528 deleted without having been removed from the factory first. This will leak standalone popupmenus and could lead to crashes. 

d: command not found
[1]+  Done                    okular equi.dvi
[1]+  Done                    okular equi.dvi

The only thing I would like to see is:

:~$ cd Documents
:~/Documents$ okular equi.dvi &

Perhaps that message was some bug, I do not care and I do not want to know about it.

Is it possible to suppress these messages?

share|improve this question

migrated from stackoverflow.com Mar 4 '12 at 9:11

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Braiam, terdon, slm, jasonwryan, Anthon Jan 29 '14 at 2:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

The particular solution for KDE apps producing tons of junk is to run kdebugdialog and unselect all. Via reddit.com/r/linux/comments/28vno2/… – MightyPork Jul 6 '14 at 10:32
up vote 5 down vote accepted

To suppress STDOUT:

yourcommand  1>/dev/null 

To supress STDERR

yourcommand  2>/dev/null

Since bash 4 you can suppress both:

yourcommand &>/dev/null

You could also disable KDE's debug information with kdedebugdialog tool and disable output for selected modules (or all debug output).

share|improve this answer

You can send the STDOUT and STDERR of the program to the dummy device /dev/null:

$ okular equi.dvi &> /dev/null &

To supress the job control messages, you can disable monitor mode in bash (maybe in your .bashrc):

$ set +m

I wouldn't recommend this, though. To enable it again, use set -m.

share|improve this answer

If you want to suppress all text, just use the following command:

$> yourcommand >/dev/null &

If you also want to redirect stderr, you can do so like this:

$> yourcommand >/dev/null 2>&1 &
share|improve this answer

Use this:

okular equi.dvi > /dev/null 2>&1 & 

this will send all output (error messages and regular output) to /dev/null.

share|improve this answer

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