UNIX/LINUX Command – tail

March 1, 2019

Comments

NAME

tail—Output the last part of files

SYNOPSIS

tail [-c [+]N[bkm]] [-n [+]N] [-fqv] [–bytes=[+]N[bkm]] [–lines=[+]N] [–follow] [–quiet] [–silent] [–verbose] [–help] [–version] [file…]
tail [{-,+}Nbcfklmqv] [file…]

DESCRIPTION

This manual page documents the GNU version of tail. tail prints the last part (10 lines by default) of each given file; it reads from standard input if no files are given or when a filename of – is encountered. If more than one file is given, it prints a header consisting of the file’s name enclosed in ==> and <== before the output for each file.

The GNU tail can output any amount of data, unlike the UNIX version, which uses a fixed size buffer. It has no -r option (print in reverse). Reversing a file is really a different job from printing the end of a file; the BSD tail can only reverse files that are at most as large as its buffer, which is typically 32KB. A reliable and more versatile way to reverse files is the GNU tac command.

OPTIONS

tail accepts two option formats: the new one, in which numbers are arguments to the option letters, and the old one, in which a + or – and optional number precede any option letters.

If a number (N) starts with a +, tail begins printing with the Nth item from the start of each file, instead of from the end.

Options Description
-c N, –bytes N Tail by N bytes. N is a non-zero integer, optionally followed by one of the following characters to specify a different unit.Tail by N bytes. N is a non-zero integer, optionally followed by one of the following characters to specify a different unit.
b        512-byte blocks
k        1-kilobyte blocks
m       1-megabyte blocks
-f, –follow Loop forever, trying to read more characters at the end of the file, on the assumption that the file is growing. Ignored if reading from a pipe. If more than one file is given, tail prints a header whenever it gets output from a different file, to indicate which file that output is from.
-l, -n N, –lines N Tail by N lines. -l is only recognized using the old option format.
-q, –quiet, –silent Never print filename headers.
-v, –verbose Always print filename headers.
–help Print a usage message and exit with a non-zero status.
–version Print version information on standard output then exit.

Satish Kumar

Satish Kumar

I am Satish Kumar, Founder of LinuxConcept. Linux and F.O.S.S enthusiast, love to work on open source platform and technologies.

Related Posts

UNIX/LINUX Command – rsync

UNIX/LINUX Command – rsync

NAME rsync – a fast, versatile, remote (and local) file-copying tool rsync Command SYNOPSIS Local: rsync [OPTION…] SRC… [DEST] Access via remote shell:Pull: rsync [OPTION…] [USER@]HOST:SRC… [DEST]Push: rsync [OPTION…] SRC… [USER@]HOST:DEST Access via rsync...

UNIX/LINUX Command – strip

UNIX/LINUX Command – strip

NAME strip—Discard symbols from object files. SYNOPSIS strip [ -Fbfdname|–target=bfdname ] [ -Ibfdname|–input-target=bfdname ] [ -Obfdname|–output-target=bfdname ] [-Rsectionname|–remove-section=sectionname ] [ -s|–strip-all ] [-S|-g|–strip-debug ][-x|–discard-all...

UNIX/LINUX Command – expand

UNIX/LINUX Command – expand

NAME expand—Convert tabs to spaces SYNOPSIS expand [–tab1[,tab2[,…]]] [–t tab1[,tab2[,…]]] [–i] [—tabs=tab1[,tab2[,…]]] [–initial] [–help] [–version] [file…] DESCRIPTION This manual page documents the GNU version of expand. expand writes the contents of each given...

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

1 × three =

News & Updates

Join Our Newsletter