Combining Log Levels (err and warn)
Another example of combining more than one log level is “err and warn” where it will display error logs and warning logs
sudo dmesg --level=err,warn
How to View Kernel Messages in Linux | dmesg Command
The Linux kernel, the core of the Linux operating system, communicates with the hardware and manages system resources. To monitor and troubleshoot the kernel’s interactions with the hardware and software components, the dmesg command comes in handy. In this article, we will delve into the details of the dmesg command, exploring its functionalities and understanding how it can be used to view kernel messages on a Linux system.
Table of Content
- What is dmesg Command
- Usage of dmesg command:
- 1. Viewing Logs Page-Wise with Less
- 2. Colorizing dmesg Output
- 3. Human-Friendly Timestamps
- 4. Standard Date and Time Format
- 5. Monitoring Real-Time Logs
- 6. Viewing Specific Number of Messages with Head
- 7. Viewing Last 10 Messages with Tail
- 8. Case-Insensitive Searching
- 9. Searching for Disk Related Messages
- 10. Filtering Messages by Log Level (Info)
- 11. Combining Multiple Log Levels
- 12. Combining Log Levels (err and warn)
- 13. Filtering Messages for Specific Network Interface (eth0)
- 14. Filtering Messages by Facility (daemon)
- 15. Decoding Facility and Level
- How to view kernel messages in Linux – FAQs