Displaying the last lines of files (tail command)

Use the tail command to write the file specified by the File parameter to standard output beginning at a specified point.

See the following examples:
  • To display the last 10 lines of the notes file, type the following:
    tail notes
  • To specify the number of lines to start reading from the end of the notes file, type the following:
    tail -20 notes
  • To display the notes file one page at a time, beginning with the 200th byte, type the following:
    tail -c +200 notes | pg
  • To follow the growth of the file named accounts, type the following:
    tail -f accounts
    This displays the last 10 lines of the accounts file. The tail command continues to display lines as they are added to the accounts file. The display continues until you press the (Ctrl-C) key sequence to stop the display.