Linux – Shutting up KDE applications launched from the command line

guikdelinuxterminal

Whenever I launch a KDE application from the command line, for instance okular to view a pdf, I get spammed with tons of warnings and various messages that I am not interested in. Even hours after I shut the program I get random messages in that terminal. Here is a sample:

kded(26751)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
kded(26751)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
kded(26751)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:
kded(26751)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:

You get the idea. How can I turn this behavior off for all KDE applications without having to append something like >/dev/null every single time?

I'm using KDE 4.4.5.

Best Answer

Personally, I'd just shut the programs up by 2>/dev/null. Either you have to throw all error messages for all applications, or keep a list of binary names somewhere with the programs you want to be quiet.

To keep the list, you could e.g. put overloading scripts in your PATH with names corresponding to the binaries, e.g. okular:

#!/bin/sh
/usr/bin/okular "${@}" 2>/dev/null

Alternatively, you could create a script called e.g. q (for quiet) and put it in your path with contents:

#!/bin/sh
"${@}" 2>/dev/null

and then add aliases such as

alias okular="q okular"

and so on.

Related Question