In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the relevant knowledge of the use of Linux's tailf command, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this Linux tailf command. Let's take a look at it.
The common Linux command tailf command is almost equivalent to tail-f, which should be more similar to tail-- follow=name strictly speaking. It can also continue to trace when the file is renamed, which is especially suitable for log file tracking (follow the growth of a log file).
Tailf displays several lines at the end of the specified file on the screen, which is usually used for the trace output of log files
Note that unlike tail-f, if the file does not grow, it will not access the disk file. Tailf is especially suitable for tracking log files on laptops because it saves power and reduces disk access. The tailf command is not a script, but a binary execution file compiled in C code, which is not available after some Linux installations.
The difference between tailf and tail-f
Tailf always reads from the beginning of the file, while tail-f starts at the end of the file.
When tailf check files grow, use the file name, using the stat system call; and tail-f uses the open file descriptor; Note: tail can also achieve a similar effect of tracking file names; but tail always uses fstat system calls instead of stat system calls; the result is: by default, when tail files are secretly deleted, tail does not know, and tailf knows.
The syntax tailf logfile # dynamically tracks the log file logfile, initially printing the last 10 lines of the file. The option-n,-- lines NUMBER # outputs the last few lines-NUMBER # is the same as NUMBER `- n NUMBER'-V,-- version # outputs version information and exits-h,-- help # displays help and exits the parameter target: specify the target log.
Example tailf log/WEB.LOG tailf-n 5 log2014.log # shows the last five lines of the file. This is the end of the article on "what is the use of Linux's tailf command?" Thank you for reading! I believe you all have a certain understanding of the knowledge of "what is the use of Linux's tailf command". If you want to learn more, 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.