In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article shows you what is the specific method of Linux system to find log keywords, the content is concise and easy to understand, it can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
The log is a very important file in the Linux system. We often check the log at work, but there is a lot of data recorded in the log. How can we quickly find the data we want to see?
Suppose there is a log file hrun.log, and the keyword for the query is "New user":
View log cat hrun.log according to keyword | grep "New user"
View the last 10 lines of cat hrun.log according to the keyword | grep "New user"-A 10
View the first 10 lines of cat hrun.log according to keywords | grep "New users"-B 10
View the first and last 10 lines of the log according to the keyword, and display the line number cat-n hrun.log | grep "New user"-C 10
View the first 50 lines of the log cat hrun.log | head-n 50
50 lines after viewing the log, and the line number cat-n hrun.log is displayed | tail-n 50
Description:
After-An indicates the keyword, After
-B indicates the keyword before Before
-C indicates before and after the keyword, Context
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
The above is the specific method of Linux system to find log keywords, have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.