Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
cat -n haiku.txt | tail -n 7   # display the last 7 lines of haiku.txt
cat -n haiku.txt | tail -n +7  # display text in haiku.txt starting at line 7
cat -n haiku.txt | tail +1210    # display text in haiku.txt starting at line 1210

When you use the tail -n +<integer> syntax it will display all output from that line to the end of its input. So to view only a few lines starting at a specified line number, pipe the output to head:

...