At 15:15 06/07/2004. Steve Bertrand had this to say:
>I often have the need to remove hundreds or even thousands of files from a
>single directory (very often). Using rm, I usually get:
>pearl# rm -rvf *
>/bin/rm: Argument list too long.
>Is there any way to work around this instead of having to select a small
>bunch of files at a time to remove?

find /path/to/dir -exec rm -rvf {} \;

use /path/to/dir instead of cd /path/to/dir; find . ... because
it is very easy to forget the cd /path/to/dir step.  Doing
find . -exec rm -rvf {} \; in, for example, / is Not Recommended(tm)
Also, there is a space between the {} and the \;, don't skip it,
as cryptic error messages result.

man find for more info on what you can do with find.


[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to