Just to piggyback on this, the source code for the BSD utils is eminently readable and simple, almost always more so than the equivalent GNU options. I understand that there are reasons for this, and I'm obviously very grateful for all sorts of GNU software. But if I want to see how something works, I'm going to go for the BSD sources first if they exist.