Item exists but doesn't

I have a folder I want to delete from a defunct steam library. I seem to be stuck with some files that aren’t assigned any permissions or an owner.

I’ve tried giving the items an owner or setting permissions with chown and chmod but get the same “No such file or directory” error.
I then tried making a text file with nano but couldn’t save as it said file name already existed in the directory.

image

I’m not sure what’s going on there - I would generally trust Steam to manage it’s own stuff…

However, my favourite ‘nuke’ command to remove a tree is this:

sudo rm -vdrRRf

You can do this from a parent directory - don’t get it wrong, because there’s no confirmation.

This will remove - it won’t mess with permissions.

If there are no files in that directory that you need to keep, you could try deleting the directory itself (rm -r /path/to/directory). If there are files you need there, move them out first, delete the directory, recreate it then move to kept files back.
Alternatively, check that there aren’t any hidden spaces (or similar) in the filenames with
ls --quoting-style=shell

1 Like

What kind of filesystem is this, is it a nativ linux filesystem?

It looks a little bit like a damaged one. Depending on the filesystem, you might want to run a filesystem check first. If it is not a native linux filesystem, use a appropriate OS for it.

3 Likes

Do you have a backup of everything ? (Last call) :footprints:

1 Like

Yeah. Should have used steam to delete it but I didn’t.

Drive was formatted btrfs.

Gave it another look this morning and I was able to delete one of the three folders with an rm command but the remove command sends the permissions on the identically named (but not deleted) items whack.

By unmounting the drive and remounting it the permissions were fixed up and I could go back and delete another. Rinse and repeat for a third time and we’re all fixed.

I can only assume things were not playing well because three folders had the exact same name in the same directory. Weird.