The xargs
and find
programs have separate origins but
are collected together in Findutils because they are often used
together. While today they also share a small amount of
implementation, this wasn’t originally the case. The locate
program started out as a feature of find
but today it is a
separate program.
find
A find
program appeared in Version 5 Unix as part of the
Programmer’s Workbench project and was written by Dick Haight. Doug
McIlroy’s A Research UNIX Reader: Annotated Excerpts from the
Programmer’s Manual, 1971-1986 provides some additional details; you
can read it on-line at
https://www.cs.dartmouth.edu/~doug/reader.pdf.
GNU find
was originally written by Eric Decker, with
enhancements by David MacKenzie, Jay Plett, and Tim Wood. The idea
for ‘find -print0’ and ‘xargs -0’ came from Dan Bernstein.
xargs
The xargs
program was invented by Herb Gellis at Bell Labs. In
his own words:
Hi James, Thanks for reaching out. Yes I invented
xargs
way back before we even released UNIX to the general public when it was running on PDP-11 machines with little memory, and capable shell programs were not there yet - kind of like early IBM PC-DOS command lines. The name came about, first, by noticing at the time there were no commands beginning with ‘x’ (silly reason, I know), and then came up with, basically, "eXecute command with ARGumentS". This obviously allowed one to process files, sequentially, including batches of files, while the UNIX command line buffer was very tiny. I don’t remember exactly how small but possibly only 512 bytes. The very first use intended was to allow compiling C programs that were broken into many small routines whose total name length would exceed the command line buffer. Hope this settles the matter! Oh, another arcane factoid aboutxargs
at the beginning was that I was able to keep it smaller than 4k (I think that was the amount) which at the time was the maximum size of a file segment on PDP-11/UNIX, so that the program could be loaded completely on the first segment, without having to go back and get chains of further segments - Hence fast!
In 2023, GNU xargs
is unfortunately much larger, around 75KiB
when stripped.
GNU xargs
isn’t derived from the original Bell Labs program.
It was originally written by Mike Rendell, with enhancements by David
MacKenzie.
locate
4.3-BSD introduced the fast-find feature, in which the command
find needle
would look for a file named ‘needle’. This
took advantage of the fact that, at the time, there was no valid
two-argument find
invocation. The implementation was much
faster than searching the whole file system in real time, because it
used a pre-built file name database. This functionality is described
in more detail in Finding Files Fast by James Woods (Usenix
;login, Volume 8 Issue 1, pages. 8-10, 1983).
Standardisation of find
led to this functionality being moved
into the locate
program in 4.4-BSD. The command find
needle
now unambiguously means “start searching at the file
needle
and print the names of the files you encounter”.
GNU locate
and its associated utilities were originally written
by James Woods, with enhancements by David MacKenzie.