filename with '-'
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Debian support > Linux Debian support > filename with '-'




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    filename with '-'  
JD


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 12:18 AM

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





[ Post a follow-up to this message ]



    Re: filename with '-'  
Felix M. Palmen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 12:18 AM

* 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  Ribbo
n
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 New
s





[ Post a follow-up to this message ]



    Re: filename with '-'  
CodeWright


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 12:18 AM


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






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:44 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register