"Linux" tail command

Source: Internet
Author: User

Use

The tail command is primarily used to remove a few lines behind


Full Name

The full name of the tail command is tail (tail)


Parameters

-N: followed by a number, which indicates the meaning of a few lines

-F: Loop read

-Q: Do not display processing information

-V: Displays detailed processing information


Case

Case one: show the last 5 lines of the file

[email protected] ~]# tail-5/etc/man_db.conf
#
#---------------------------------------------------------
# Flags.
# NOCACHE keeps mans from creating cat pages.
#NOCACHE


Case two: Cycle through the contents of a file

[[email protected]/]# ping localhost >test.txt &

[4] 9944
[email protected]/]# tail-f test.txt
bytes from localhost (127.0.0.1): icmp_seq=1791 ttl=64 time=0.112 ms
bytes from localhost (127.0.0.1): icmp_seq=1792 ttl=64 time=0.161 ms
bytes from localhost (127.0.0.1): icmp_seq=1793 ttl=64 time=0.166 ms
bytes from localhost (127.0.0.1): icmp_seq=1794 ttl=64 time=0.133 ms

....


To end Press CTRL + C


Case three: Displaying files starting from line 5th

[email protected]/]# tail-n +5/etc/man_db.conf
# their PATH environment variable. For details see the Manpath (5) Mans page.
#
# Lines beginning with ' # ' is comments and is ignored. Any combination of
# tabs or spaces may be used as ' whitespace ' separators.
#
# There is three mappings allowed in this file:
# --------------------------------------------------------
# Mandatory_manpath Manpath_element
# Manpath_map Path_element manpath_element
# Mandb_map Global_manpath [Relative_catpath]
#---------------------------------------------------------

......

"Linux" tail command

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.