• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Unable to delete a weird directoryish

Joined
Aug 26, 2019
Messages
571 (0.27/day)
After more than a decade of apathy and negligence, I'm finally cleaning up and organizing the data in my life e.g. running fslint on my venerable NAS (Debian with mdm), finishing getting rsnapshot setup, et al.

One step was moving data from an external HDD to my NAS. While cleaning up said data now on my NAS, I encountered a directoryish that I can't delete despite every trick I know. Note where it said it's a directory and not a directory in the command output. Odd, right? Thoughts on how i can get it deleted?
Bash:
# ls
'Fran?ois Couperin'
#ls -lah
ls: 'Fran?ois Couperin': No such file or directory
total 0
drwxr-xr-x+ 3 jdoe jdoe 0 Nov  4 02:11  .
drwxr-xr-x+ 3 jdoe jdoe 0 Nov  3 11:40  ..
drwxr-xr-x  3 jdoe jdoe 0 Aug 15  2014 'Fran?ois Couperin'
# ls -il
ls: 'Fran?ois Couperin': No such file or directory
total 0
239210 drwxr-xr-x 3 jdoe jdoe 0 Aug 15  2014 'Fran?ois Couperin'
# find . -inum 239210 -exec rm -i {} \;
rm: cannot remove './Fran?ois Couperin': Is a directory
find: ‘./Fran?ois Couperin’: Not a directory

Note: I can cd into it. The below result is upon running ls -lah after cding into it.
Bash:
# cd Fran\?ois\ Couperin/
.../Music/Fran?ois Couperin# ls -lah
ls: cannot open directory '.': No such file or directory
 
Last edited:
I suspect the torrent had an illegal character. Did you try using quotes around the name? What filesystem is it?
 
Filesystem is jfs.

François Couperin was a baroque composer. Origin was a CD rip as that was my only music medium in that era. If it matters, it was originally on a Fat32 partition on the external drive before I brought it over to my jfs NAS yesterday. (I regularly used 4 different OSes any given day at the time, hence the use of Fat32.) Edit: My music listening was done on a MBP though. I just now wondered if maybe OSX has better support for ç or some such, but in testing just now, I was able to touch and rm a ç named file without issue. Sadly I cannot check and see how well I can intereact with the original directory on the external HDD's Fat32 partition, as after copying everything over to the NAS, I zeroed it out.

Didn't try quotes as I was just using autocomplete via tabbing. Tried just now, to no avail. (Same result with "" as well.)

Bash:
# ls
'Fran?ois Couperin'
# rm -r 'Fran?ois Couperin'
rm: cannot remove 'Fran?ois Couperin': No such file or directory
# rm -r 'Fran\?ois\ Couperin/'
rm: cannot remove 'Fran\?ois\ Couperin/': No such file or directory
# rm -r 'Fran\?ois\ Couperin'
rm: cannot remove 'Fran\?ois\ Couperin': No such file or directory

P.s. As a side note, mv does not work either.
 
Last edited:
Filesystem is jfs.

François Couperin was a baroque composer. Origin was a CD rip as that was my only music medium in that era. If it matters, it was originally on a Fat32 partition on the external drive before I brought it over to my jfs NAS yesterday. (I regularly used 4 different OSes any given day at the time, hence the use of Fat32.)

Didn't try quotes as I was just using autocomplete via tabbing. Tried just now, to no avail. (Same result with "" as well.)

Bash:
# ls
'Fran?ois Couperin'
# rm -r 'Fran?ois Couperin'
rm: cannot remove 'Fran?ois Couperin': No such file or directory
# rm -r 'Fran\?ois\ Couperin/'
rm: cannot remove 'Fran\?ois\ Couperin/': No such file or directory
# rm -r 'Fran\?ois\ Couperin'
rm: cannot remove 'Fran\?ois\ Couperin': No such file or directory
That's a tough one. Here are some tips that might work, like using a regular expression to catch the dir:

If those do not work and if you still have the original drive I would try fixing the name before copying over...
 
Good idea in trying a wildcard just in case. Still to no avail though.
Bash:
# rm F*
rm: cannot remove 'Fran?ois Couperin': Is a directory
# rm -r F*
rm: cannot remove 'Fran?ois Couperin': No such file or directory
# rm -rfi F*
rm: descend into directory 'Fran?ois Couperin'? y
rm: cannot remove 'Fran?ois Couperin': No such file or directory
Bash:
# find -maxdepth 1 -name F*
./Fran?ois Couperin
# find -maxdepth 1 -name F* -delete
find: cannot delete ‘./Fran?ois Couperin’: No such file or directory

What I find nutty is when I try to take the direct inode approach.
Bash:
# find . -inum 239210 -exec rm -i {} \;
rm: cannot remove './Fran?ois Couperin': Is a directory
find: ‘./Fran?ois Couperin’: Not a directory
 
Last edited:
And did you try rmdir?
 
Just a quick update.

After some other ineffectual steps and running fsck -f on /dev/md0 i.e. the mdadm raid drive on the NAS, since I was connected into the NAS anyway, I tried to delete the now infamous Fran\?ois\ Couperin while logged into the NAS itself -- and it deleted successfully.

I went to the other problematic files (all same origin of MBP iTunes, saved to Fat32, copied to NAS), and successfully deleted those as well while logged into the NAS.

So all set, though I'm completely baffled as to why I could not delete them via my linux clients.
 
So all set, though I'm completely baffled as to why I could not delete them via my linux clients.

It depends on what shell environment you were using to execute the rm commands.
 
Bash, Gnome terminal in Ubuntu. Bash, Xfce terminal in Slackware.
 
Back
Top