I am trying to remove a file using rm. However, if I do ls, all the information about the file is ?????? ?? ?? example.txt... And calling rm returns that no such file exists. How can I force a remove of the file?
2 Answers
You can try:
rm -f example.txt
Or
touch example.txt && rm -f example.txt
(update timestamp on the file first)
Or
chmod 777 example.txt && rm -f example.txt
(set readable, writeable, executable then remove it).
As suggested above, fsck
is a good idea as well.
-
-
Don't know. I can see nothing wrong with it. I upvoted, but it should be at 1 now... Aug 4, 2010 at 7:36
-
Depends on the filesystem used, but most of the time you need to check the filesystem with fsck (the variant of it, whatever your filesystem is).