Sunday, 20 January, 2002

Unix find Command Difficult to Use

The Unix find command is the most over-engineered and hard to use utility I've ever had the displeasure to need.  Who thought this thing up?  Sure, it's powerful but that power comes at a cost:  ease of use.  One would think that whoever built the tool would make the interface easy for the most common uses and users.  It's all well and good to require complicated or non-intuitive syntax for infrequent uses, but the most common use should be simple.  For example, if you want to find a file that you know is somewhere in the directory structure below the current working directory, you have to type:

find . -name filename -print

 Egads.  Sorry, folks, but that's just wrong.  Heck, even DOS is easier:

dir filename /s

Yes, I know that find can do much more than dir.  It can execute programs, format the output, brush your teeth, and comb your hair if you have any left after trying to decipher the man page:

find - search for files in a directory hierarchy

find [path...] [expression]

This manual page documents the GNU version of findfind searches the directory tree rooted at each given file name by evaluating the given expression from left to right, according to the rules of precedence (see section OPERATORS) until the outcome is known (the left hand side is false for and operations, true for or), at which point find moves on to the next file name.

(Remainder of 700 lines removed)

What?  I don't care about expressions, operator precedence and all that rot, I just want to find a freakin' file!  I read that first paragraph and decided I'd go look for a simpler program.  I really didn't want to spend 30 minutes learning the tool just to find a file that I knew was in one of a half dozen places.  Kind of like flying a 747 down to the convenience store.

I'm all for powerful tools for advanced users, but not at the expense of simple tools for the most common uses.  Keep your find.  I'm going to write something usable.