Ubuntu – Hide debug information when running apps from the command line

command linegedit

Most of the time running a gtk application from the command line it starts dumping debug information to the stdout even though I put them in background.

Example:

~$ gedit test.html # and ctrl+z to suspend
zsh: suspended  gedit .zshrc
~$ bg
[1]  + continued  gedit .zshrc
~$
# do some editing
(gedit:6208): GtkSourceView-WARNING **: Could not find word to remove in buffer (whoosh), this should not happen!

(gedit:6208): GtkSourceView-WARNING **: Could not find word to remove in buffer (haystack), this should not happen!

I want to note that the error, or warning, changes according to what I'm doing at the moment. The GtkSourceView-WARNING shown here is one of the cases.

Anyway… Do you know if it's at all possible to avoid getting that information printed out?

Best Answer

You can send those standard output and error messages to the null device, so that they don't show up in your terminal, e.g. gedit test.html >/dev/null 2>&1

Related Question