How can I get the source code for the linux utility tail? How can I get the source code for the linux utility tail? linux linux

How can I get the source code for the linux utility tail?


The tail utility is part of the coreutils on linux.

I've always found FreeBSD to have far clearer source code than the gnu utilities. So here's tail.c in the FreeBSD project:


Poke around the uclinux site. Since they distributed the software, they are required to make the source available one way or another.

Or, you could read man fseek and guess at how it might be done.

NB-- See William's comments below, there are cases when you can't use seek.


You might find it an interesting exercise to write your own. The vast majority of the Unix command-line tools are a page or so of fairly straightforward C code.

To just look at the code, the GNU CoreUtils sources are easily found on gnu.org or your favorite Linux mirror site.