help with command line deletion

Norman Gray norman at astro.gla.ac.uk
Thu Apr 19 02:44:39 PDT 2007


On 2007 Apr 18 , at 22.57, LuKreme wrote:

> On 18-Apr-2007, at 09:39, Martin Costabel wrote:
>> Or use the -delete flag:
>
> When did the find included in OS X start supporting -delete  
> though?  I learned the -exec rm {} \; syntax specifically because I  
> couldn't use -delete

This sort of thing is why I prefer the general technique of piping  
'find's output to something else to do the work (in this case, the  
deletion).  That way, I don't have to worry about whether this Unix's  
find has some funky flag or not, and I don't have to read the find  
manpage (again) to remind myself of the syntax, and try to remember  
how I'm supposed to escape the {}, and whether I need the \; or not,  
and whether -delete deletes a directory's contents before the  
directory itself.

Tools are supposed to be orthogonal -- find finds things.

All the best,

Norman


-- 
------------------------------------------------------------------
Norman Gray  :  http://nxg.me.uk
eurovotech.org  :  University of Leicester, UK




More information about the MacOSX-admin mailing list