[Novalug] rm question

James Ewing Cottrell III JECottrell3@Comcast.NET
Sat Oct 12 19:44:44 EDT 2013


never Never NEVER use "-exec rm {} \;"

It forks a separate process for each file.

The new idiom is "-exec rm {} \;", which acts like xargs, gathering as 
many files as it can.

JIM

On 10/10/2013 1:42 PM, John Franklin wrote:
> If you're going to be using -exec rm {} \; then be sure to wrap the {} in quotes.  Otherwise, filenames with spaces won't work they way you think.  At best, you'll get some "file not found" errors.  At worst, you'll delete files you didn't intend.  That's because when find hits a file like "name with space.txt", it'll try to delete three files: "name", "with" and "space.txt".
>
> jf
>




More information about the Novalug mailing list