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?
EDIT
The file went away after restarting. My guess is that it was a glitch in finder.
sudo
from a terminal, it's going to look in the current directory, not necessarily where the fileXYZ.txt~
is. I'm guessing this is the source of yourNo such file of directory
errors.sudo
command from the same location as the file.touch XYZ.txt~
in that directory in the terminal, then deleting that newly created file?