Re: Deleting many files from a directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mark Nipper wrote:

> > To remove all files in all subdirectories do:
> > 
> > find /path/ -type f | xargs -n 50 rm
> > 
> > Thats much faster than 'find ...-exec...'
> 
> 	That can get a little strange though if files have spaces
> or other strange characters in their names.

Using:

	find /path -type -f -print0 | xargs -0 -n 50 rm

will cope with filenames which contain whitespace.

-- 
Glynn Clements <glynn@xxxxxxxxxxxxxxxxxx>
-
: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Newbie]     [Audio]     [Hams]     [Kernel Newbies]     [Util Linux NG]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Device Drivers]     [Samba]     [Video 4 Linux]     [Git]     [Fedora Users]

  Powered by Linux