4

I have some weird files and folders in my trash on Mac OS X. After I "empty" the trash, the files still remain. I attempted to manually delete the files:

$ cd /Volumes/VOLUME/.Trashes/501/foldertobedeleted
$ rm -rf * # there's nothing I need here
[...]
rm: somanyfolders: Directory not empty

Weird, right? So I track down the files:

$ ls /Volumes/VOLUME/.Trashes/501/foldertobedeleted/somanyfolders
Φύλλο κόντακτ.mkpdf           Προσαρμογή σε 3x5.mkpdf
Περικοπή σε 3x5.mkpdf          Προσαρμογή σε 4x6.mkpdf
Περικοπή σε 4x6.mkpdf          Προσαρμογή σε 5x7.mkpdf
Περικοπή σε 5x7.mkpdf          Προσαρμογή σε 8x10.mkpdf
Περικοπή σε 8x10.mkpdf

Well, that's annoying. These files didn't even show up in Finder! Well, let's just delete them:

$ cd /Volumes/VOLUME/.Trashes/501/foldertobedeleted/somanyfolders
$ rm *
rm: Φύλλο κόντακτ.mkpdf: No such file or directory
rm: Περικοπή σε 3x5.mkpdf: No such file or directory
rm: Περικοπή σε 4x6.mkpdf: No such file or directory
rm: Περικοπή σε 5x7.mkpdf: No such file or directory
rm: Περικοπή σε 8x10.mkpdf: No such file or directory
rm: Προσαρμογή σε 3x5.mkpdf: No such file or directory
rm: Προσαρμογή σε 4x6.mkpdf: No such file or directory
rm: Προσαρμογή σε 5x7.mkpdf: No such file or directory
rm: Προσαρμογή σε 8x10.mkpdf: No such file or directory

What? ls showed all the files though! How can I delete these files?

  • 1
    Isn't this something useful:how-to-delete-this-undeletable-directory? – somethingSomething Jun 2 '15 at 19:10
  • 1
    @somethingSomething As far as I can see, the OP of the question was unable to resolve their issue, they asked an administrator for help with deleting the concerned files. – Streetlamp Jun 3 '15 at 2:05
  • Hope thats ok, I just skimmed the post and thought there might be some helpful information there, I don't know much about it myself. Good luck. – somethingSomething Jun 3 '15 at 2:29
1

I don't have access to OSX so this is a wild guess... but you can try other techniques to delete files, rather than relying on the shell's globbing to match. Try:

find . -not -type d -print -delete

or even

find . -not -type d -print | perl -nle 'print; unlink'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.