In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what is the use of the tail command in Linux", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is the use of tail command in Linux" this article.
The Linux common command tail command can be used to view the contents of a file, and there is a common parameter-f that is often used to look up changing log files.
Tail displays several lines at the end of the specified file on the screen
Add that the tail command is used to input the tail of the file.
The last 10 lines of the specified file are displayed on the screen by default.
When working with multiple files, lines with file names are appended to each file.
If no file is specified or the file name is -, the standard input is read.
If the NUM value indicating the number of bytes or lines is preceded by a + sign, it is displayed from the NUM entry at the beginning of the file instead of the last NUM entry of the file.
The NUM value can be followed by a suffix:
B: 512
KB: 1000
K: 1024
MB: 1000 * 1000
M: 1024 * 1024
GB: 1000 * 1000 * 1000
G: 1024 * 1024 * 1024
T, P, E, Z, Y, and so on.
Syntax tail (option) (parameter) option-c,-- the NUM (NUM is an integer) byte content at the end of the bytes=NUM output file. -f,-- follow [= {name | descript}] displays the latest appended contents of the file. "name" means to monitor changes in the file name. -F has the same function as "--follow=name-- retry". -n,-- line=NUM outputs the contents of the tail NUM (NUM digits) line of the file. -- pid= is used with the "- f" option to automatically exit the tail command when the process of the specified process number terminates. -Q,-- quiet,-- silent does not output individual file names when there are multiple file parameters. -- retry means that when the tail command starts, the file is inaccessible or later becomes inaccessible, always trying to open the file. Use this option in conjunction with the option "--follow=name". -s,-- sleep-interal= is used with the "- f" option to specify the number of seconds between monitoring file changes. -v,-- verbose always outputs each file name when there are multiple file parameters. -- help displays help information for instructions. -- version displays the version information of the instruction. Parameter file list: specifies the list of files to display the tail content.
Example tail file # (displays the last 10 lines of the file file) tail-n + 20 file # (displays the contents of the file file, from line 20 to the end of the file) tail-c 10 file # (displays the last 10 bytes of the file file) tail-25 mail.log # shows that the last 25 lines of mail.log tail-f mail.log # is equivalent to-- follow=descriptor, tracked according to the file descriptor when the file is renamed or deleted Tracking stops tail-F mail.log # is equivalent to-- follow=name-- retry, trace according to the file name, and keep retry, that is, after the file is deleted or renamed, if you create the same file name again, you will continue to track all the contents of the article "what is the use of the tail command in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, 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.