|
Home > Archive > Linux Debian support > January 2007 > filename with '-'
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
|
| Hello,
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
| |
| Felix M. Palmen 2007-01-06, 7:18 pm |
| * JD <jd@something.com>:
> 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.
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- <fmp@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
| |
| CodeWright 2007-01-06, 7:18 pm |
|
Felix M. Palmen wrote:
> * JD <jd@something.com>:
>
> This is kind of a unix shell faq ;)
>
> Include two dashes (--) in your command line. after Them, nothing is
> interpreted as an option.
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
|
|
|
|
|