Home > Articles

  • Print
  • + Share This
This chapter is from the book

tail

The tail command displays the bottom part of text data. By default, the last ten lines are displayed. Use the -n option to display a different number of lines:

[student@localhost ~]$ cal 1999 | tail -n 9
     October                 November                 December
Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa   Su Mo Tu We Th Fr Sa
                1  2       1  2  3  4  5  6             1  2  3  4
 3  4  5  6  7  8  9    7  8  9 10 11 12 13    5  6  7  8  9 10 11
10 11 12 13 14 15 16   14 15 16 17 18 19 20   12 13 14 15 16 17 18
17 18 19 20 21 22 23   21 22 23 24 25 26 27   19 20 21 22 23 24 25
24 25 26 27 28 29 30   28 29 30               26 27 28 29 30 31
‘

Important options include the following:

Option Description
-f Display the bottom part of a file and follow changes means to continue to display any changes made to the file.
-n +x Display from line number x to the end of the file.
  • + Share This
  • 🔖 Save To Your Account