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 -????????? ? ? ? ? ? pb072313.jpg -????????? ? ? ? ? ? pb072314.jpg
john@boss:/media/disk/data/draw/camera/misc> ls -la pb0723* ls: cannot access pb072302.jpg: Input/output error ls: cannot access pb072303.jpg: Input/output error ls: cannot access pb072304.jpg: Input/output error ls: cannot access pb072305.jpg: Input/output error
Is there any way to delete these? Thanks, John.
I also recently had a number of zero length files left over from a process gone wrong, with some illegal/unprintable characters in the filenames. To remove them was fairly simple: find . -size 0 -print0 | xargs -0 rm -f 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. -- =================================================== Rodney Baker VK5ZTV rodney.baker@iinet.net.au =================================================== -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org