Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I apologize for the possibly misleading title, but it is the best way I could think of to describe the problem, which is: I have several files that I can cat, but when I try to rm them I get a "No such file or directory" error.

$ cat "A11 D5 D5.txt"
... OUTPUT ...
$ rm -f "A11 D5 D5.txt"
rm: cannot remove `A11 D5 D5.txt': No such file or directory

I've tried overwriting the file and can execute the remove without error, but the file is still there; I can still cat the file.

$ echo "Boom" > "A11 D5 D5.txt"
$ cat "A11 D5 D5.txt"
Boom
$ rm -f "A11 D5 D5.txt"
$ cat "A11 D5 D5.txt"
Boom
$ rm -f "A11 D5 D5.txt"
rm: cannot remove `A11 D5 D5.txt': No such file or directory

I'm at a complete loss. I suspect a reboot would fix the problem, but I am really more interested in why such a thing would happen. Some sort of filesystem problem? (I don't have reboot privileges for the system; it's a university cluster.)

Edit: I get the following output

$ ls
A11 D5 D5.txt
$ ls -b
A11\ D5\ D5.txt
$ printf '<%q>\n'
<''>

I've also stated the file (just in case):

$ stat A11\ D5\ D5.txt 
  File: `A11 D5 D5.txt'
  Size: 5               Blocks: 8          IO Block: 131072 regular file
Device: 1bh/27d Inode: 18446744068941111933  Links: 1
Access: (0644/-rw-r--r--)  Uid: (  596/  <username>)   Gid: ( 1015/<group>)
Access: 2012-12-09 22:48:29.000000000 -0600
Modify: 2012-12-09 22:56:44.835662498 -0600
Change: 2012-12-09 22:56:44.835662498 -0600

Edit 2: The filesystem is apparently of type "fuse" and

$ ls -lb A11\ D5\ D5.txt
-rw-r--r-- 1 <username> <group> 5 Dec  9 22:56 A11\ D5\ D5.txt
share|improve this question
    
what does ls show? –  Karthik T Dec 10 '12 at 5:35
    
What is the output of printf '<%q>\n' *? –  Chris Down Dec 10 '12 at 6:28
    
Specifically, look at ls -b –  Kevin Dec 10 '12 at 6:29
    
What does df -T ./A11\ D5\ D5.txt | awk '{print $2}' give. And ls -lb ./A11\ D5\ D5.txt ? –  Sukminder Dec 10 '12 at 6:52
1  
It's definitely an oddity of this FUSE filesystem. A filesystem driver can make rm a no-op: it's technically possible, but normally not done that way. What filesystem is it? –  Gilles Dec 10 '12 at 22:58

1 Answer 1

You can try to using tools to determine the filename for you if you think it has some special characters you can't see.

ls | xargs -i rm -i {}

or

find . -exec rm -i {} \;
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.