john boris on 6 Jul 2016 07:45:06 -0700

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

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

I have been following this and haven't answered as I live 99% of the time in SCO (hold the laughs). Anyway I deal with this a routine basis as my users constantly type crazy things. Anyway it was suggested earlier to do an ls -al  which might show the control characters that are in the file name., What I have done is:
ls -al | more   or less choose your viewer.

That will usually show the weirdness in the file names. I look at the real ascii characters to see a pattern and test this with an ls 
ex.  ls -al *dd*  where the dd is the pattern I found in my first ls try.

I should get at a minimum the file with the weird name. Then I do 

rm -i *dd* 

when the file with the weird name comes up I answer yes.

In my experience with Ubuntu I have found that rm is linked to rm -i anyway but in SCO it isn't. 

If this is a NFS share I have also found weirdness but again with SCO. I don't want to repeat what others may have said but if you can get onto the NAS device and do the removal from there that might help.

Another issue that may not be easily ruled out is if the Share is used by other users or the file is used by other users. They could have the file in use without you knowing it. 

One last thought (another SCOism) if the sticky bit is set on the file it would have to be removed by the person who created the file. Not sure if that is valid in your case.

On Tue, Jul 5, 2016 at 7:08 PM, Greg Helledy <> wrote:
This system does not have lsof installed.  I know that the file got there through the FTP server software (as a user upload), and the file is still undeletable when the server is not running.

I tried unmounting and remounting the share, then deleting the file again.  No change to the results of a delete command.

If I try to delete the directory the file is contained in, I get:
rmdir: failed to remove ‘test’: Device or resource busy

On the ownership issue:  all of the files and directories on the NAS mount show up as owned by root.  I have no idea how file permissions are actually handled in the (presumably NTFS) filesystem on the device.  But I was able (as root) to delete other files in that directory...only this single file gave me a problem.

The $ indicated and end of line.  It's not actually in
the file name, I'm pretty sure it's output from ls rather than being
the file name:

Oh, my mistake.

Greg Helledy
GRA, Incorporated
P:  +1 215-884-7500
F:  +1 215-884-1385
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --

John J. Boris, Sr.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --