I have a filename starting with '-' on my system (saved webpage).
How do I remove such a file? All commands I know interpret the '-' as a
command-line option.
Thanks
This is kind of a unix shell faq ;)
Include two dashes (--) in your command line. after Them, nothing is
interpreted as an option.
Greetings, Felix
--
Felix M. Palmen (Zirias) \ -PGP- <f...@palmen.homeip.net> /"\ ASCII Ribbon
web: http://zirias.ath.cx/ \ http://zirias.ath.cx/pub.txt \ / Campaign
my open source projects: \ FP ED9B 62D0 BE39 32F9 2488 X Against HTML In
http://zirias.ath.cx/?pg=pro \ 5D0C 8177 9D80 5ECF F683 / \ Mail And News
That's not entirely true.
/Some/ utilities recognize the double dash option (--) as an "end of
options" marker, but some do not.
In any case, it is always safe to use a qualified path that /does not/
start with a dash to access (i.e. delete, copy, etc) files who's names
start with a dash
Thus, instead of
rm -.txt
use
rm ./-.txt
or
rm /full/path/to/-.txt
This works in /all/ shell environments, with /all/ utilities, whether
they recognize the double dash option or not.
HTH
--
Lew