Andrew Libby on 5 Jul 2016 12:48:01 -0700


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

Re: [PLUG] Undeletable file, how to get rid of it?


Some ideas that come to mind:

1) ls -a | cat -A
   This will show non-printable characters in the filename.  It might
  very well be that you've got some in there that are tripping up the
  shell or rm.

2) lsattr/ chattr.  I believe you can set/ unset an attribute that
  prevents removal of the file.  Though the message you're getting
  seems to suggest it's not attributes.


   https://en.wikipedia.org/wiki/Chattr

Good luck.

Andy




On 7/5/16 3:42 PM, Greg Helledy wrote:
> A user found they couldn't delete a directory on their FTP account and
> called me for help, thinking their permissions had been changed.
> It turns out that the reason is there's a file they uploaded that the OS
> can't delete.
> The FTP server is running on linux; the user's FTP directory is stored
> on a separate NAS device on the LAN.  It is mounted with cifs at boot.
> 
> I've searched for help on this but answers provided seem to focus on the
> case where the filename has spaces or other embedded non-visible
> characters.  In that case, using Midnight Commander or another program
> that lets you select and delete the file, works.
> 
> I cannot.  MC says "Cannot stat [filename]  No such file or directory (2)"
> 
> If I type "rm" and the first character of the filename and hit tab, the
> system brings up the rest of the filename properly.  If I then hit
> enter, I get:
> rm: cannot remove ‘filename’: No such file or directory
> 
> This result was unexpected, I don't know what that means:
> touch: cannot touch ‘filename’: No such file or directory
> 
> How do I delete a file like this, that's simultaneously there and not
> there?  Is there any way to prevent this from recurring?
> 

-- 
Andrew Libby
alibby@xforty.com
484-887-7505 x 1115
http://xforty.com
http://www.kineticweb.com/
http://zugunroute.com
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug