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 -ain 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.

sudofrom 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 directoryerrors. – Andy Smith Sep 12 '11 at 18:41sudocommand from the same location as the file. – dsg Sep 12 '11 at 18:51touch XYZ.txt~in that directory in the terminal, then deleting that newly created file? – Nick Sep 12 '11 at 18:57