How do I disable messages or logging from printing on the console/virtual terminals?
My wireless driver is noisy. It prints out messages to the console every 10-30 seconds. So, if I'm working on VT1 or something, I get messages scrolling by all the time. Is there a way to shut this feature off? I like working on the virtual terminals, but this is making it hard to deal with. :)
You can use the command
sudo dmesg -n 1
to suppress all messages from the kernel (and its drivers) except panic messages from appearing on the console.
To fix at each boot, add the command to:
dmesgcomes with two handy options for that:
-D, --console-off disable printing messages to console -E, --console-on enable printing messages to console
dmesg -Dis just a shortcut for
dmesg -n 1, except that it stores the current log level, so that you can easily restore it with
dmesg -E. So it's a bit more convenient than changing the log level with
Additionally, you can check the current log level with:
$ cat /proc/sys/kernel/printk 7 4 1 7
man klogctlfor more explanations on these numbers...
You can also set the log level directly with
echo 1 > /proc/sys/kernel/printk
which is basically what
The format of that file is explained at: https://superuser.com/a/793692/128124
loglevelcommand line boot parameter
Sets the initial value at boot time, which allows you to see pre-init messages.