Re: rm a file with name '--min-size=8'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Yuandan Zhang wrote:
> Hi,
> I incidantly created file named as '--min-size=8'. In fact, I don't know how
> it was created. I have difficulty to remove it using "rm -rf \--min-size=8
> or other ways?

GNU rm, like most other GNU tools, will treat a single set of double hyphens
("--") as the end of the option listing, so everything after it will be taken
literally, so something like the following should work:

$ rm -i -- --min-size=8

(Note the "-i" option: Be sure that the file it is asking to delete is the file
that you want to remove. rm can be a both a very useful tool and an extremely
dangerous weapon against one's system. Think of it as analogous, in some ways,
to a knife: Extremely useful when used properly, but it can be quite deadly if
great care is not taken in its use.)

Alternatively, you can escape every hyphen and equals sign within the file name:
$ rm -i \-\-min\-size\=8

I'm a big fan of using the double-hyphen method though, as it's clearer to me.

Hope that helps.
-- 
Peter Gordon (codergeek42)
This message was sent through a webmail
    interface, and thus not signed.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux