On 27/11/09 00:01, Rodney Baker wrote:
On Thu, 26 Nov 2009 22:34:52 John Bennett wrote:
An external disk had a bit of a prob when copying data to it, and I now have a bunch of corrupted files on it: -????????? ? ? ? ? ? pb072311.jpg -????????? ? ? ? ? ? pb072312.jpg
In your case you could use something like:
find . -maxdepth 1 -name pb\*.jpg -print0 | xargs -0 rm -f
The -print0 | xargs -0 takes care of non-printable characters/special characters/spaces in the file names and ensures that they're passed through intact to the rm -f command. The -maxdepth 1 stops recursion into subdirectories and the wildcard needs to be escaped (hence the backslash) otherwise find will complain that "paths must precede expressions".
HTH.
Rodney.
Nope, still no joy...: john@boss:/media/disk/data/draw/camera/misc> sudo find . -maxdepth 1 -name pb\*.jpg -print0 |xargs -0 rm -f root's password: rm: cannot remove `./pb012292.jpg': Permission denied rm: cannot remove `./pb012293.jpg': Permission denied rm: cannot remove `./pb012294.jpg': Permission denied rm: cannot remove `./pb012295.jpg': Permission denied rm: cannot remove `./pb012296.jpg': Permission denied Ah well, might have to do the "task of no return" - ie format.... :-( I actually suspect that it is the external enclosure that is creating the prob... it is a Ritmo, and I don't hold a lot of faith in them... Thanks, John -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org