bug in rm???

Tim Currie tim at algernonsystems.com
Sat Jan 3 14:38:15 UTC 2004


Joolz wrote:

>Just a moment ago something weird happened. I was cleaning up files
>and noticed a very strange behaviour of the rm command. AFAIK Linux is
>case-sensitive, so you van have three files TeST, test and TEST in one
>directory. But I deleted more than I wanted to (no big deal, rm is the
>issue)
>
>So I tried this:
>
>  #!/bin/bash
>  touch TEST
>  touch TeST
>  touch test
>  ls # all three are there
>  rm te*
>  ls # ALL THREE ARE GONE???
>
>IMO this is _very_ dangerous behaviour, one would expect Linux command
>to be compatible with the Linux filesystem (maybe rm is a port of del
>:-\)
>
>Is this a known issue? Right know I have only Fedora at hand, but I
>wonder if other distro's have it too.
>
>  
>
Ok, so you made me nervous. I tried it on several machines:

[tcurrie at hamster tmp]$ touch TEST
[tcurrie at hamster tmp]$ touch TeST
[tcurrie at hamster tmp]$ touch test
[tcurrie at hamster tmp]$ ls
test  TeST  TEST
[tcurrie at hamster tmp]$ rm te*
[tcurrie at hamster tmp]$ ls
TeST  TEST
[tcurrie at hamster tmp]$

...works fine on RedHat 9.0...

tcurrie at nakedpc:~/tmp$ touch test
tcurrie at nakedpc:~/tmp$ ls
TEST  TeST  test
tcurrie at nakedpc:~/tmp$ rm te*
tcurrie at nakedpc:~/tmp$ ls
TEST  TeST
tcurrie at nakedpc:~/tmp$

...Slackware 9.0 has no problem with it, and last but not least,

[tcurrie at localhost tmp]$ touch test
[tcurrie at localhost tmp]$ ls
test  TeST  TEST
[tcurrie at localhost tmp]$ rm te*
[tcurrie at localhost tmp]$ ls
TeST  TEST
[tcurrie at localhost tmp]$

...a fresh install of Fedora Core 1 has no problem with it. Are you sure 
you're not doing something strange here? What is the underlying 
filesystem (ext2, ext3, reiserfs)? How are you accessing this? NFS? Samba?

-Tim

-- 
Proprietary software is like petrified wood. It used to be alive, but
then it was fixed in time and put in a box. GNU/Linux software, in
contrast, is alive, always changing and improving. I love that it's
more a process than a product.  - Pamela Jones, Groklaw







More information about the fedora-list mailing list