Common Linux log files name and usage--reference
|
Example 10: Viewing compressed log filesAfter a specific time all the system log files are rotated,and compressed. You can uncompress it on the fly,and pipe the output to another unix command to view the file as explained below.<div class="block-panel">Display the first N lines of a compressed file.$ zcat file.gz | head -250 <div class="block-panel">Display the last N lines of a compressed file.$ zcat file.gz | tail -250 <div class="block-panel">Ignoring the last N lines of a compressed file.$ zcat file.gz | head -n -250 <div class="block-panel">Ignoring the first N lines of a compressed file.$ zcat file.gz | tail -n +250 <div class="block-panel">Viewing the lines matching the pattern$ zcat file.gz | grep -A2 'error' <div class="block-panel">Viewing particular range of lines identified by line number.$ zcat file.gz | sed -n -e 45p -e 52p reference:http://www.coolcoder.in/2013/12/common-linux-log-files-name-and-usage.html(编辑:开发网_运城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 在liunx中创建启动器(window下的快捷方式) && linux下,
- Linux环境下实现生产者消费者问题
- 在linux中启动rewrite服务命令
- sql-server – FreeTDS – tsql连接,isql失败
- 除了root之外的所有内容的Apache mod_rewrite
- 诺基亚Lumia 930紫屏怎么办?可通过升级到WP8.1解决
- linux – 什么是dd if = / dev / zero of = / EMPTY bs = 1
- 在linux主机上挂载/打开虚拟机磁盘映像(vdi)
- node中socket.io的事件使用详解
- linux – 客户端在故障转移期间未切换到辅助DNS服务器

