Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] removing duplicate files

On 04/07/07, Kevin Shackleton <kevins@xxxxxxxxxxxx> wrote:

To explain more about my remove duplicate file problem . .

# rm -rv <somefile>


rm: cannot lstat `<somefile>': No such file or directory

Is "somefile" the exact file name (e.g. full path name or full path between
current working dir and the file?). If not then it indeed won't lookup the
file in the directories underneath and you need to use "find".

If the file is in your current working directory and just typing "rm
<somefile>" doesn't find it then I suspect the name you type is not the
right one - maybe there are control characters or unicode characters in the
file name?

See "man ls" for ways to ask ls to display special characters like "-b",
"-N", or "-q". If you go the "-N" way then pipe the output through "cat -v
-t -e".

The problem is in lstat, not rm.  The problem is that it's not recursing
the directories.

It's not a problem - that's the way it's supposed to happen. See "man rm".

Neither will Gnome File Browser search these directories.

The problem I suspect is that over time having copied this set of
directories several times through different file systems, including as a
share from a Windows VMWare session, the property bits of the directory
entries have been made incorrect.  They are executable, as per Matthew
Hannigan's post on Monday.  I can cd through the directories and they
appear to be correct in every other way except recursing through them.

How do you define "recursing through them"?

(they are mp3 data and just to be different xmms does recurse when asked
to load a directory that has subdirectories)

So it can't be a permissions problem - all processes of the same user are
equal in the eyes of the filesystem.

Any thoughts?  And a command to fix the several hundred directories too

First let's decide what exactly is the problem before trying to hit it
randomly until it breaks, shall we?