GNU bug report logs -
#10819
[BUG][RM]
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
tag 10819 needinfo
thanks
On 02/15/2012 08:05 AM, jeremy.magrin <at> epitech.eu wrote:
> Hello,
>
> I'm writing to you to inform you of a possible bug in the linux "rm"
> command.
> I've experienced that when using by error the said command as following :
> "rm - rf#*"
That's (probably) not a valid command. By putting a space between - and
r, you are asking rm to remove the literal files named "-" and any files
that match the glob "rf#*". Did you mean to type "rm -rf #*" instead,
which says to recursively and without warning remove any files that
match the glob "#*"?
It would help us if your report was actual copy-and-paste contents of
what you really did: ls to list directory contents beforehand, then the
rm call you used, then ls afterwards to show what remains, as well as
how that differs from your expectations.
> if there is no file named #*# (* being the same as in the console,
> anything) in the current directory, rm quits as expected because of the
> incorrect syntax.
> But if there is a file named #*#, rm deletes all the current file's
> content except the said file.
Meanwhile, I'm going to guess that you may be hitting one of our FAQ on
how globbing works, and how to make rm remove what you want it to remove:
https://www.gnu.org/software/coreutils/faq/#Why-doesn_0027t-rm-_002dr-_002a_002epattern-recurse-like-it-should_003f
Look at other FAQ in the vicinity.
--
Eric Blake eblake <at> redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[signature.asc (application/pgp-signature, attachment)]
This bug report was last modified 13 years and 94 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.