[plug] Deleting/Moving files beginning with '-'

Padraig MacIain draoidh at iinet.net.au
Tue Oct 25 11:05:42 WST 2005


On Tue, Oct 25, 2005 at 10:31:59AM +0800, Shannon Carver wrote:
> Hi Guys, 
> 
> In light of the find -exec query, I thought I'd ask my question on how to
> delete files from a shell that start with a hyphen/dash.  My solution thus
> far, has just been to use Nautilus/Konqueror as its handled them fine, but I
> know there must be a way to handle them, but I just can't find the right
> command to do it.
> 
> The problem with the hyphen of course, is it takes the next letter or
> letters after the hyphen as options like cp -a etc etc.
> 
> I've tried all the things I can think of, escaping the hyphen, putting it in
> quotes, this hasn't worked.
> 
> Whats the solution?
> 


i think it is something like :

	cp -a -- -filewithhyphen

the -- tells the cp command to treat all following leading hyphens as part
of the filename as opposed to switches.

P.



More information about the plug mailing list