dmesg | tail -20输出最后20行日志,当你插入可移动设备时它是非常有用的
dmesg -l emerg查看紧急日志
日志级别
1emerg: System is unusable.
2alert: Action must be taken immediately. 3crit: Critical conditions.
4err: Error conditions.
5warn: Warning conditions.
6notice: Normal but significant condition. 7info: Informational.
8 debug: Debug-level messages.
dmesg日志重启后会消失,可以用kdump
sudo apt install -y kdump-tools
dmesg -c可以清除本次日志,下次开机看不到上次的日志了
dmesg通常可grep配合使用