In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "linux how to view the last few lines of data in the file". In daily operation, I believe many people have doubts about how to view the last few lines of data in the file by linux. The editor consulted all kinds of information and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the doubts of "how to view the last few lines of data in the file by linux". Next, please follow the editor to study!
In linux, you can use the tail command to view the last few lines of data, which is used to view the tail of the file; simply execute the "tail-n line value filename" command to view the specified number of lines of data from the end of the file.
The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
Linux looks at the last few lines of data in the file
Use the tail command
To view the last few lines of data in the file, you can use:
Tail-n row value filename
Example: tail-n 20 filename
Can display the last 20 lines of filename
Description:
The tail command is used to view the tail content in the file. The tail command displays the last 10 lines of the specified file on the screen by default. If more than one file is given, each file displayed is preceded by a file name title. If no file is specified or the file name is "-", standard input is read.
Note: if the N value indicating the number of bytes or lines is preceded by a "+" sign, it is displayed from the N item at the beginning of the file instead of the last N item of the file. The N value can be followed by a suffix: B for 512, k for 1024, m for 1, 048576 (1m).
Syntax format:
Tail [parameters] [file]
Parameters:
-f loop read
-Q does not display processing information
-v displays detailed processing information
Number of bytes displayed by-c
-n displays the contents of the last n lines of the file
-- pid=PID is used with-f to indicate that it ends after the process ID,PID dies.
-Q,-- quiet,-- silent never outputs the first part of the given file name
-s,-- sleep-interval=S is used with-f to indicate dormancy for S seconds at intervals of each iteration.
At this point, the study on "how to view the last few lines of data in a file by linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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: 223
*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.