[PLUG] How To Remove "Ghost" Files?

Fred James fredjame at fredjame.cnc.net
Fri Oct 8 14:09:46 UTC 2010


Rich Shepard wrote:
>    This morning's report on the dirvish backup reported errors of files being
> removed before they could be backed up. This in a directory that I've not
> accessed for several years so nothing should have changed any files there.
> As a matter of fact, I've done nothing in that partition recently.
>
>    Anyway, I cannot remove this spurious files as they have no information
> associated with them when displayed. Here's an example:
>
> ?????????? ? ?        ?          ?                ? xdbctl_8h-source.htm
>
>    While I'd like to understand how these files became corrupted, I don't
> need them so the more important question is how to delete them.
>
>    I've tried, as root, putting the file name in double quotes but the system
> tells me the file does not exist.
>
>    Your thoughts and suggestions on how to clean this up are wanted.
>
> TIA,
>
> Rich
Rich Shepard
One way would be to ...
    (a) cp all files except the 'unwanted' ones to a new (temporary) 
directory outside of their current directory
    (b) rm -rf the directory in which the 'unwanted' files reside
    (c) mkdir the deleted directory again
    (d) mv all those 'good' files to the recreated directory
    (e) rm -rf the temporary directory that you made in step 'a'
... there are other ways, of course
Regards
Fred James




More information about the PLUG mailing list