Viewing file endings with tail

Occasionally, you might also need to use tail, which displays the last lines of a file. tail is particularly handy for checking footers or for updating information in a footer (see Code Listing 6.5). Just as with head (described in the previous pages), tail offers several options for viewing files.

To view file endings with tail:

  • tail honeydo
    At the shell prompt, type tail followed by the file name. As Code Listing 6.5 shows, you'll see the last ten lines on the screen.

To view a specified number of lines:

  • tail -15 honeydo
    Here, all you do is add a specific number of lines you want to view (-15).

To view the endings of multiple files:

  • tail honey* | more
    Pipe the tail command and the files (multiple files indicated ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.