69. Common Linux Shell functions, tail

Source: Internet
Author: User

1. Tail-output the last part of Files

Tail [Option] [+/-num]... [file]...

2. Option

①-F,: Output appended data as the file grows;

②-S,: With-F, sleep for S seconds (default 1.0) between iterations.

③-N,: output the last n lines, instead of the last 10

④-C: output the last n Bytes

The second is commonly used for tracking logs to display new log information.

Note:

①+ Num is displayed after row num.

②-Num is displayed starting from the num row at the end of the file.

3. Example

Tail-N 3 File // equivalent to tail-3 File

Tail-N + 3 File // displayed after line 1, tail + 3 File

Tail-F File

Tail-F-S 2 File

Reference

[1]Http://linux.die.net/man/1/tail

[2]Https://wangyan.org/blog/linux-head-tail.html

[3]Http://blog.csdn.net/carzyer/article/details/4759593

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.