ADVERTISEMENT

Linux Commands ❯ tail

tail

Print the last 10 lines of each FILE to standard output.
syntax:

tail [OPTION]... [FILE]...
  • tail my_file1
    print the last 10 lines from my_file1
  • tail -c 100 my_file1
    print the last 100Bytes from my_file1
  • tail -c +100 my_file1
    print the entire contents of my_file1 starting from 100th Byte
  • tail -f my_file1
    print the last 10 lines from my_file1, wait and update the display while any new lines added to the file.
  • tail -f -s 2 my_file1
    print the last 10 lines from my_file1, wait and update the display while any new lines added to the file in every 2 seconds
  • tail -n 5 my_file1
    print the last 5 lines from my_file1
  • tail -n +5 my_file1
    print the entire contents of my_file1 starting from 5th line
  • tail -q my_file1 my_file2
    quietly display the last 10 lines from my_file1 and my_file2 without any header information