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

How to use the tail command of Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to use the tail command of Linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn how to use the tail command of Linux.

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.

Command format: tail [parameter] [file] parameter:-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 output 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.

To display the last 10 lines of the notes.log file for the instance, enter the following command:

Tail notes.log # displays the last 10 lines by default to track the growth of the file named notes.log, enter the following command:

Tail-f notes.log this command displays the last 10 lines of the notes.log file. When some lines are added to the notes.log file, the tail command continues to display them. Display continues until you press the (Ctrl-C) key combination to stop the display.

Displays the contents of the file notes.log, from line 20 to the end of the file:

Tail-n + 20 notes.log displays the last 10 characters of the file notes.log:

Tail-c 10 notes.log so far, I believe you have a deeper understanding of "how to use Linux's tail command". 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.

Share To

Development

Wechat

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

12
Report