In this guide, we will explore how to disable noisy wireless driver messages on Ubuntu console or virtual terminals. This can be particularly useful if you are trying to focus on other console outputs and these messages are causing distractions.
To disable noisy wireless driver messages on Ubuntu console or virtual terminals, you can use the
dmesg command with the
-n 1 option to set the log level to only display emergency messages. You can also make this change persistent by adding the command to the
/etc/rc.local file. Additionally, you can use the
dmesg -D option to temporarily disable the messages or set the log level directly by echoing a value to the
Understanding Console Messages
Console messages are outputs from the system kernel and its drivers that provide information about system operations. These messages can be helpful for debugging and monitoring system performance. However, they can also be noisy and distracting, especially when you’re trying to focus on other console outputs.
One of the most straightforward ways to suppress these messages is by using the
dmesg command. The
dmesg command is used to control or print the kernel ring buffer.
To suppress all messages from the kernel and its drivers except panic messages from appearing on the console, you can use the following command:
sudo dmesg -n 1
-n option sets the level at which logging of messages is done to the console. The
1 level means that only emergency messages, i.e., system is unusable, will be logged.
To make this change persistent across reboots, add this command to the
/etc/rc.local file. This file is used to execute commands at system startup.
echo 'dmesg -n 1' | sudo tee -a /etc/rc.local
tee command is used to append the output to a file. The
-a option tells
tee to append the output to the end of the file instead of overwriting it.
dmesg with Options
dmesg command also provides two handy options:
dmesg -Dis equivalent to
dmesg -n 1, which disables printing messages to the console.
dmesg -Erestores the previous log level, enabling printing messages to the console.
These options can be useful for temporarily disabling or enabling console messages without changing the log level permanently.
Setting the Log Level Directly
Another method to suppress these messages is by setting the log level directly. This can be done by echoing a value to the
echo 1 | sudo tee /proc/sys/kernel/printk
This command sets the log level to
1, which suppresses most kernel messages from appearing on the console. This method is essentially what the
dmesg command does behind the scenes.
Disabling noisy wireless driver messages on Ubuntu console or virtual terminals can help you focus on other important console outputs. The
dmesg command and the
/proc/sys/kernel/printk file provide flexible ways to control the log level of these messages. Remember to use these commands responsibly, as they can affect the information available for debugging system issues.
To check the current log level for console messages, you can use the command
dmesg --console-level. This will display the current log level in the output.
To enable all console messages again after disabling them, you can use the command
dmesg -E. This will restore the previous log level and enable printing messages to the console.
Yes, you can disable specific types of console messages by setting the log level accordingly. The log levels range from
0 (emergencies only) to
7 (all messages). For example, setting the log level to
3 will disable debug messages and lower priority messages from appearing on the console.
To find out more information about the
dmesg command and its available options, you can refer to the command’s manual page by running
man dmesg in the terminal. The manual page provides detailed explanations and examples of how to use the command.