For some reasons, I have a file in one of my directories that I cannot delete:
$ ls -al
drwxrwxr-x 2 xxx xxx 4096 Oct 10 14:05 ''$'\r'
(more files follow...)
The problem is that I cannot delete it. I tried rm ''$'\r'
and ls
using wildcards to at least see what it matches, but had no success. Interestingly, ls -al ?
, ls -al ??
, etc. does not list the file.
Probably I could delete the entire directory and restore the other files afterwards, but I think it should be possible to 1) list the proper file name, and 2) then delete the file using this name.
I finally managed to do it this way:
ls -i # find the inode of the file
find . -inum 4350083 -delete
Not sure why the name is not listed in a form that can be entered. I tried enclosing it in $'...' but this also did not work.