Common Linux log files name and usage--reference
|
In the following example,you can view the content of var/log/cron from line number 101 to 110.M – Starting line numberN – Ending line number<div class="block-panel"> Example 2: Display first N lines of a file using head commandThis example displays only first 15 lines of /var/log/maillog file. Change 15 to 10 to display the first 10 lines of a log file.?<div class="block-panel"> Example 3: Ignore last N lines of a file using head commandThis example shows how to ignore the last N lines,and show only the remaining lines from the top of file. The following example will display all the lines of the /var/log/secure except the last 250 lines.<div class="block-panel"> Example 4: Display last N lines of the file using tail commandThis example displays only last 50 lines of /var/log/messages file. Change 50 to 100 to display the last 100 lines of the log file.<div class="block-panel"> Example 5: Ignore first N-1 lines of the file using tail commandThis example shows how to ignore the first N-1 lines and show only the remaining of the lines. The following example ignores the 1st four lines of the /etc/xinetd.conf,which contains only the comments.<div class="block-panel"> (编辑:网站开发网_马鞍山站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |

