In daily work, we often need to view logs. For example, we can view logs in real time through the tail command, or we can view log information through commands such as cat . But now we are going to discuss how to filter out the content we want from the log by keywords. There are many ways to do this. Today we will mainly learn about the cat command. Assume that there is a log file hrun.log , and the query keyword is "new user": View logs by keyword View the last 10 lines of logs according to keywords View the first 10 log lines by keyword View the 10 lines of logs before and after the keyword and display the line numbers View the first 50 lines of the log View the last 50 lines of the log and display the line number illustrate:
The above is all the knowledge points about finding keywords in Linux logs introduced this time. Thank you for your learning and support for 123WORDPRESS.COM. |
<<: Elegant practical record of introducing iconfont icon library into vue
>>: Examples of optimistic locking and pessimistic locking in MySQL
<br />Yesterday I saw at W3C that the new HT...
0. Introduction What is the ibdata1 file? ibdata1...
This article shares a sharing sidebar implemented...
1. First install the pagoda Installation requirem...
Table of contents 1. List interface display examp...
Key Points The CSS resize property allows you to ...
1. What is phantom reading? In a transaction, aft...
Table of contents I. Definition 2. Usage scenario...
1. Check whether port 80 is occupied. Generally, ...
a : Indicates the starting or destination positio...
Table of contents 1. Problem Description 2. Probl...
Table of contents 1. Block scope 1.1. let replace...
When developing a web project, you need to instal...
Table of contents 1. Download 2. Deployment 3. Ng...
1. Download, I take 8.0 as an example Download ad...