Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page



 

Linux / Unix tail command

Quick links

About tail
Syntax
Examples
Related commands
Linux / Unix main page

About tail

Delivers the last part of the file.

Syntax

tail [+ number] [-l] [-b] [-c] [-r] [-f] [-c number | -n number] [file]

+number
-lUnits of lines.
-bUnits of blocks.
-cUnits of bytes.
-rReverse. Copies lines from the specified starting point in the file in reverse order. The default for r is to print the entire file in reverse order.
-fFollow. If the input-file is not a pipe, the program will not terminate after the line of the input-file has been copied, but will enter an endless loop, wherein it sleeps for a second and then attempts to read and copy further records from the input-file. Thus it may be used to monitor the growth of a file that is being written by some other process.
-c numberThe number option-argument must be a decimal integer whose sign affects the location in the file, measured in bytes, to begin the copying: 

 

+Copying starts relative to the beginning of the file.
-Copying starts relative to the end of  the file.
noneCopying starts relative to the end of the file.

The origin for counting is 1; that is, -c+1 represents the first byte of the file, -c-1 the last.

-n numberEquivalent to -c number, except the starting location in the file is measured in lines instead of bytes. The origin for counting is 1; that is, -n+1 represents the first line of the file, -n-1 the last.
fileName of the file you wish to display

Examples

tail myfile.txt

The above example would list the last 10 (default) lines of the file myfile.txt.

tail myfile.txt -n 100

The above example would list the last 100 lines in the file myfile.txt.

Related commands

cat
head
more
pg

 

Index

Category:
Linux / Unix

Companies:
Click here

Related Pages:

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope