Mailing List Archive

Support open source code!


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

Re: tlug: How to delete "-h.tgz" ???



>>In article <13832.42978.255281.333613@example.com>, "Stephen J. Turnbull" <turnbull@example.com> writes:

>>>>> "Karl-Max" == Karl-Max Wagner <karlmax@example.com> writes:
>>> I just typed "gzip -h" assuming I'd get a list of
>>> options. Instead it created a file called "-h.tgz".
>>> 
>>> These commands told me -h is not a legal option: rm -h.tgz rm
>>> "-h.tgz" mv -h.tgz h.tgz
>>> 
>>> Any idea how I get rid of this file?

Karl-Max> Escape the "-" with a "\" in front.

> This can't work because the \ is a shell escape, and it's rm that's
> interpreting the - as a switch.

Protect the '-' with './' ---

	rm ./-h.tgz

Sometimes (but not with the rm I just tried it on) options aren't
looked for after the first file name (does NOT work here :-)

	touch xyz; rm xyz -h.tgz

Sometimes '--' signifies end of optiosn (DOES work here):

	rm -- -h.tgz

But the ./-h.tgz is the classic answer.

-- 
            ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
     Felix Finch: scarecrow repairman & rocket surgeon / felix@example.com
  PGP = 91 B3 94 7C E9 E8 76 2D   E1 63 51 AA A0 48 89 2F  ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
---------------------------------------------------------------
Next Meeting: 10 October, 12:30 Tokyo Station Yaesu central gate
Next Nomikai: 20 November, 19:30  Tengu TokyoEkiMae 03-3275-3691
---------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links