In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
The main content of this article is to explain "how the linux system displays the contents of the file in the command dynamic state". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn how the linux system uses commands to display the contents of files in a dynamic state.
In general, the service logs in WEB systems are text-based and are scrolling all the time. If it's troublesome to open a file every time we happen to start or monitor, let's talk about this today.
Preparatory work
1. First, use SSH to demo the directory on some * nix, which is assumed to be / home/duser/demo, and store a file called demo.txt with the first line Hello World written on it.
2. Next you need to know the commands that will be used. Head file: show the first 10 lines; tail file: show the last 10 lines; (described in the next step). If you can't understand or can't read the English in the picture, it doesn't matter. I will explain the important parameters.
Use the tail file command
1. Let's use the tail demo.txt command to see the effect. If you are careful, you will find that after this command is displayed, you will soon exit the current command, indicating that it will not scroll automatically.
2. Let's use the tail-f demo.txt command to see the effect. In the figure, we can see that the command has been suspended, indicating that it is waiting for a change, and then output.
3. Then we will open demo.txt for direct editing, random input, and remember to save. So, is it possible to view it dynamically?
4. Sometimes, the default display of 10 lines shows too little information, so we use the-n parameter to increase the number of rows displayed. Here we give an example of the difference between 10 lines and 20 lines.
Finally, if you want to know more, you can get more by typing the command tail-- help.
At this point, I believe you have a deeper understanding of "how the linux system displays the contents of the file in the command dynamic state". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.