1

The file name is ._03 Überlin.mp3, and it lives in a folder on a Western Digital NAS external drive, being accessed on a Mac:

$ ls -al
total 128
drwxrwxr-x@ 1 kraftydevil  staff   264 Jul 23 03:58 .
drwxrwxr-x@ 1 kraftydevil  staff   296 Jul 24 05:30 ..
-rw-rw-rw-  1 kraftydevil  staff  4096 Aug 24  2013 ._03 Überlin.mp3

Attempts

Finder: Simple Delete
enter image description here
Yields "The operation can't be completed because one or more required items can't be found. (Error code -43)"

Finder: Delete Enclosing Folder
enter image description here
Yields "The operation can't be completed because the item "album" is in use."

Terminal: rm Attempts

$ #escape the space
$ rm ._03\ Überlin.mp3 
rm: ._03 Überlin.mp3: No such file or directory

$ #escape the space and the 'Ü'
$ rm ._03\ \Überlin.mp3 
rm: ._03 Überlin.mp3: No such file or directory

$ #escape the space, the 'Ü', and the '_'
$ rm .\_03\ \Überlin.mp3 
rm: ._03 Überlin.mp3: No such file or directory

$ #use single quotes
$ rm '._03 Überlin.mp3'
rm: ._03 Überlin.mp3: No such file or directory

$ #use double quotes
$ rm "._03 Überlin.mp3"
rm: ._03 Überlin.mp3: No such file or directory

$ #use --
$ rm -v -- ._03\ Überlin.mp3 
rm: ._03 Überlin.mp3: No such file or directory

Terminal: Delete With 'find'

find . -type f -name "._*" -perm +w -delete

No output and the file persists

Terminal: Delete By Inode Number Lookup

$ ls -ali
total 128
94691 drwxrwxr-x@ 1 kraftydevil  staff   264 Jul 24 12:45 .
96821 drwxrwxr-x@ 1 kraftydevil  staff   296 Jul 24 12:33 ..
94756 -rw-rw-rw-  1 kraftydevil  staff  4096 Aug 24  2013 ._03 Überlin.mp3

$ find . -inum 94756 -delete
find: -delete: unlink(./._03 Überlin.mp3): No such file or directory
13
  • 1) What filesystem & where was it mounted when the -_ files were created? Best guess, not a Mac & that's a remaining resource fork/ACL attributes left over from another machine. 2) try sudo rm then just drag the file from finder to terminal - it should figure out any odd syntax requirement. 3) Run First Aid. Report back ;)
    – Tetsujin
    Jul 24, 2020 at 17:47
  • Or, at the worst, rename the folder, copy the contents except for the one to delete to a new folder with the original name, and delete the whole renamed folder. Jul 24, 2020 at 17:59
  • @Tetsujin - 1) I believe it was a Mac. Even if it wasn't - there were other files starting with "._" in the directory that were successfully deleted using rm -rf [parent folder], so it makes me think the issue is the special characters somehow 2) sudo yields the same rm results 3) I'm unable to run First Aid. The drives don't show up in Disk Utility. I would expect them to show up under 'External' but only the hard drive shows up under 'Internal'. Running First Aid on the Internal hard drive yields normal results Jul 24, 2020 at 19:34
  • @DrMoishePippik - unfortunately moving / renaming doesn't allow me to delete it Jul 24, 2020 at 19:36
  • 1
    Usually find does the trick: touch ._03\ Überlin.mp3 followed by find -type f -name .\*Ü\*3 -exec rm -v {} \; 2> /dev/null gives me the expected result: removed './._03 Überlin.mp3'. It is necessary to repeat the spaces between the parameters and brackets.
    – alle_meije
    Jan 17, 2023 at 10:28

1 Answer 1

1

Use the MacOS Finder ctrl-select (right click) -> Get Info on the file

You should then be able to edit the file name in the "Name & Extension" field.

I've just tested this with various combinations of special symbols and chars, and all seemed to be renamable back to some simpler charset with no difficulty.

If you can't then it's not the characters which are the issue, but likely the file system itself.

You say it's both a NAS [network attached] and an "external drive" - but I'd normally consider an external drive to be directly connected via USB or some other cable.

If it's attached via network, then some other process [on the NAS itself] may be holding the file open. Check whether the drive has a USB port for using as a local drive rather than network, as then you can do the following:

If it's USB, you should reboot into single user mode [hold Command+S on reboot] and try in the single user command prompt - where as a last resort you'll also be able to use fsck to check the drive, as per this explanation :https://www.maketecheasier.com/repair-mac-hard-disk-with-fsck/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .