You are on page 1of 1

Syntax The command-syntax is: tail [options] <file_name> By default, tail will print the last 10 lines of its

input to the standard outpu t. With command line options the number of lines printed and the printing units (lines, blocks or bytes) may be changed. The following example shows the last 20 lines of filename: tail -n 20 filename This example shows the last 15 bytes of all files starting with foo: tail -c 15 foo* This example shows all lines of filename from the second line onwards: tail -n +2 filename Using an older syntax (still used in older version of Sun Solaris as the -n opti on is not supported), the last 20 lines and the last 50 bytes of filename can be shown with the following command: tail -20 filename tail -50c filename However this syntax is now obsolete and does not conform with the POSIX 1003.1-2 001 standard. Even if still supported in current versions, when used with other options (like -f, see below), these switches could not work at all.

You might also like