Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Commands for linux system to view logs

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains the "linux system log view command", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "linux system log view command" bar!

Tail command

The tail command uses the illustration:

Examples of common commands:

① dynamically view the latest write log

Tail-f filename.log # cycle to read the latest write log ctrl + c interrupt log display

② dynamically views the latest write log and filters it by keyword

Tail-f filename.log | grep 'keyword' # read the latest write log through the pipe "|" combined with the lookup command ctrl + c interrupt the log display more command

The more command uses the illustration:

Examples of common commands:

① presses the spacebar to view the contents of the file dynamically

More filename.log

Press the space key to display the next screen of the text

Press enter to display only the next line of the text

Press H key: displays a help screen with relevant help information

Press B to display the contents of the previous screen

Press Q: exit the more command.

② is combined with pipeline "|" multiple commands are used together.

More filename.log | grep 'keyword'

③ finds the content before and after keyword

More filename.log | grep 'keyword'-10 lines before B 10 # more filename.log | grep 'keyword'-10 lines before and after C 10 # thank you for reading, the above is the content of "linux system log view command". After the study of this article, I believe you have a deeper understanding of the linux system log view command, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report