dmesg 信息实时监控其改变
2015-11-30 10:23
344 查看
方法一:
最新的dmesg版本有一个 -w (
the
方法三:
最新的dmesg版本有一个 -w (
-w,
--follow) 选项,可以实时监控并输出:
$ dmesg -wH 方法二:
watch -n 0.1 "dmesg | tail -n $((LINES-6))"
the
$((LINES-6))part should make it fit nicely into your terminal.
方法三:
#!/bin/bash end=`dmesg |wc -l` while true do sleep 1 end2=`dmesg |wc -l` if [ "$end" != "$end2" ]; then dmesg |awk '{print NR, $0}'|tail -$((end2-end)) end=$end2 fi if [ "$end" -ge 1000 ] then dmesg -c >/dev/null 2>&1 echo "**********************" echo "*dmesg -c now; *" echo "**********************" end=`dmesg |wc -l` fi done
相关文章推荐
- C#五层架构
- Nginx重写规则指南 转
- 菜鸟学Linux命令:tar命令 压缩与解压缩
- Linux的sleep()和usleep()的使用和区别
- fwrite fseek fread fopen的介绍
- 释放Linux磁盘空间的一种方法
- Please verify that your device’s clock is properly set, and that your signing certificate is not exp
- Centos系统忘记root密码后重置(linux运维笔记)
- VS2013+opencv3.0配置
- 安装ubuntu kylin14.04并安装配置tomcat7和JDK1.7
- linux系统swappiness参数在内存与交换分区间优化
- 监控系统开发
- Nginx + Tomcat 动静分离实现负载均衡
- Linux命令:wget
- (十) Nepxion-Thunder分布式RPC集成框架 - 监控中心
- 配置Tomcat以指定的身份(非root)运行
- Centos7日志服务器配置
- linux中的一个看图的软件
- 虚拟机中centos磁盘扩容
- linux系统约定不同类型文件默认的颜色