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
-l Units of lines.
-b Units of blocks.
-c Units of bytes.
-r Reverse. 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.
-f Follow. 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 number The 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.
none Copying 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 number Equivalent 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.
file Name 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