I'm trying to delete a file under OSX Lion, but can't. I get the following message:

The item XYZ.txt~ can’t be moved to the Trash because it can’t be deleted.

Here's what I've tried:

  • select file and press COMMAND + DELETE (I get the message above.)
  • renaming the file in finder (There is no option to rename the file.)
  • sudo ls -a in a terminal (The file does not appear.)
  • sudo rm XYZ.txt~ (I get "No such file or directory".)

How do I remove this file?


The file went away after restarting. My guess is that it was a glitch in finder.

  • I've no experience of OSX as such, but bear in mind that when you're running sudo from a terminal, it's going to look in the current directory, not necessarily where the file XYZ.txt~ is. I'm guessing this is the source of your No such file of directory errors. – Andy Smith Sep 12 '11 at 18:41
  • 1
    It sounds like the file is marked read-only or is on a read-only file system (like a Windows NTFS volume). If you right click and get info, does it say you can Read & Write under Sharing and Permissions at the bottom? – Nick Sep 12 '11 at 18:44
  • @Andy Smith -- Thanks, but I was running the sudo command from the same location as the file. – dsg Sep 12 '11 at 18:51
  • @Nick -- When I right click on the file and click get info, nothing happens. The pop-up that usually is supposed to show up (the one that I get with other, more normal files and folders) does not show up. – dsg Sep 12 '11 at 18:53
  • 1
    It sounds like the file doesn't exist, I don't know why finder would be showing something like that though. What if you try to create a file XYZ.txt~ by typing touch XYZ.txt~ in that directory in the terminal, then deleting that newly created file? – Nick Sep 12 '11 at 18:57

Try quitting and reopening Finder.

There is a bug where files that no longer exist are still shown on the desktop (but not if you open a separate window for ~/Desktop/). It has happened to me with .download bundles and with temporary files created by ImageMagick. The files have always disappeared after I have quit and reopened Finder.

  • Have you tried restarting Finder in such cases? – Daniel Beck Aug 29 '12 at 8:59

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.