一:查看日志
1.使用cat查看日志
1)cat test.log 查看test.log日志文件的所有信息
2)cat -n test.log | grep "#" 查看test.log日志文件的中包含“#” 的行
3)分页 cat -n test.log | grep "get" | more 查看日志文件test.log 中包含“get”的字符,然后分页
4)重定向 cat -n test.log | grep "get" >test1.log 查看日志文件test.log 中包含“get”的字符,然后写入到文件test1.log 中,(>写入覆盖文件test1.log, >>追加到test1.log 文件后)
2.使用tail查看日志
1)tail -n 10 test.log 查看日志文件最后10行数据(和tail -n -10 test.log 意义一样)
2)tail -n +10 test.log 查看日志文件从10行开始,到末尾结束
3) tail -f test.log -n 1000 动态获取查看最后1000条数据
3.使用head查看日志
1)head -n 10 test.log 查看日志文件前10行数据(和head -n +10 test.log 意义一样)
2)head -n -10 test.log 查看日志文件从头部开始,到倒数第十行结束
二:拉取日志
1)如果使用securecrt(secureCRTPortable)软件,可以执行 “ sz test.log” 命令,将test.log 日志文件下载到本地,
如果sz命令不存在的话,执行“yum install lrzsz” 命令安装,安装好后使用sz命令下载;
默认下载文件的地址:
点击options-->session Options-->x/y/Zmodem 查看下载的地址
三:屏幕清理命令
1)clear (ctl + l)
2)reset