[comp.unix.shell] a compromise safe way to use find and xargs rm together

djm@eng.umd.edu (David J. MacKenzie) (10/27/90)

Here is another safe way to use find and xargs together, if you don't
mind making files with newlines in the name immune to removal.

find / ! -name '*
*' ! -name '.*
*' -atime -10 -print | xargs rm -f
--
David J. MacKenzie <djm@eng.umd.edu> <djm@ai.mit.edu>

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (10/30/90)

In article <DJM.90Oct27105828@egypt.eng.umd.edu> djm@eng.umd.edu (David J. MacKenzie) writes:
> Here is another safe way to use find and xargs together, if you don't
> mind making files with newlines in the name immune to removal.
> find / ! -name '*
> *' ! -name '.*
> *' -atime -10 -print | xargs rm -f

No! -name only checks the last component of the path. (A few versions of
find have a -path that would do the trick here, though there are still
all the other metacharacters to worry about, and this feels like quite a
kludge.)

---Dan