Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
1  
The questionmarks could also mean your file name contains characters your terminal can not display. Does ls -lha provide more information? –  matthias krull Aug 2 '10 at 15:35

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
Someone care to explain why this answer is -1? –  Mistiry Aug 3 '10 at 21:58
    
Don't know. I can see nothing wrong with it. I upvoted, but it should be at 1 now... –  pypmannetjies Aug 4 '10 at 7:36
    
Did any of those fix your problem? Thanks for the upvote! –  Mistiry Aug 4 '10 at 21:21

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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