Linux commands-Tail: Print the end of a file

Source: Internet
Author: User

Command format

tail [OPTION] ... [FILE] ...

Command parameters

-C,--bytes=[-]k
Displays the post-K-byte contents of each file.

-F,--follow[={name|descriptor}]
Continuously monitors the specified file, and when the file appends content, the new content is immediately displayed on the screen.

-N,--lines=[-]k
Displays the following K-line content for each file.

--pid=pid
Use with the-f option to terminate tail when the PID process is finished.

-Q,--quiet,--silent
Never displays the header of the file containing the given file name.

-S,--sleep-interval=n
Used in conjunction with the-F option to hibernate N seconds at each repeated interval.

-V,--verbose
Always displays the header of the file containing the given file name.

--help
Displays help information.

--version
Displays version information.

Instance

A) Displays the contents of the/etc/passwd after 5 lines.

tail-n 5/etc/passwdhuey:x:504:504::/home/huey:/bin/bashsugar:x:505:492::/home/sugar:/bin/bashming:x : 506:504::/home/ming:/bin/bashzlee:x:507:504::/home/zlee:/bin/bashgll:x:508:504::/home/gll:/bin/bash

b) Continuously observe the output of the log file App.log.

Tail-f App.log

Linux commands-Tail: Print the end of a file

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.