Question: If I want to `tail` a 25 GB textfile, does the `tail` command read the whole file?

Since a file might be scattered on a disk I imagine it has to, but I do not understand such internals well.

Answer: 
No, `tail` doesn't read the whole file, it seeks to the end then read blocks backwards until the expected number of lines have been reached, then it displays the lines in the proper direction until the end of the file, and possibly stays monitoring the file if the `-f` option is used.

Note however that `tail` has no choice but to read the whole data if provided a non seekable input, for example when reading from a pipe.

Similarily, when asked to look for lines starting from the beginning of the file, with using the `tail -n +linenumber` syntax or `tail +linenumber` non standard option when supported, `tail` obviously reads the whole file (unless interrupted).
As you can see in the [source code](http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/tail.c?id=a3d070fa3269e89dfad49fde8ea30758afa36f4b#n525) line 525, you can see the comments for the implementation.

```
 /* Print the last N_LINES lines from the end of file FD.
   Go backward through the file, reading 'BUFSIZ' bytes at a time (except
   probably the first), until we hit the start of the file or have
   read NUMBER newlines.
   START_POS is the starting position of the read pointer for the file
   associated with FD (may be nonzero).
   END_POS is the file offset of EOF (one larger than offset of last byte).
   Return true if successful.  */

```