系统相关
首页 > 系统相关> > Linux 查看日志的方法

Linux 查看日志的方法

作者:互联网

1.cat -n 文件名.log | grep '关键词' | more/less > 文件名.txt
查看文件名.log(-n 显示内容的同时显示行号)中 | 含有'关键词'的词条 | 并分页显示(空格翻页 q退出)/分页逐行可上下查阅 q退出 > 并保存到文件名.txt文件中

ps: 多个方法可通过 | 隔开一起使用 例如 ls | grep '文件名'

标签:grep,log,查看,文件名,关键词,Linux,日志,txt,分页
来源: https://www.cnblogs.com/wuyulongblog/p/16222376.html