Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Jan 2009 13:37:54 +0300
From:      Yuri Pankov <yuri.pankov@gmail.com>
To:        Anton Shterenlikht <mexas@bristol.ac.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: can't work with a file starting with dash space '- ' ?
Message-ID:  <20090116103754.GA2317@darklight.homeunix.org>
In-Reply-To: <20090116103313.GA40221@mech-cluster238.men.bris.ac.uk>
References:  <20090116103313.GA40221@mech-cluster238.men.bris.ac.uk>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Fri, Jan 16, 2009 at 10:33:13AM +0000, Anton Shterenlikht wrote:
> By mistake I saved an email attachmed as it was called, probably
> from MS world:
> - Reviewer Comments - FFEMS - Closure paper.pdf
> 
> Now I cannot delete, or rename it.
> 
> % cp -\ Reviewer\ Comments\ -\ FFEMS\ -\ Closure\ paper.pdf z
> cp: illegal option --  
> usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-lpv] source_file target_file
>        cp [-R [-H | -L | -P]] [-f | -i | -n] [-lpv] source_file ... target_directory
> % rm -\ Reviewer\ Comments\ -\ FFEMS\ -\ Closure\ paper.pdf 
> rm: illegal option --  
> usage: rm [-f | -i] [-dIPRrvW] file ...
>        unlink file
> % 
> 
> I can view it with xpdf, but that's about all.
> I tried wildcards and quotes, sh, csh, bash, tcsh and superuser but no luck.
> 
> How can I delete or rename this file?
> 
> many thanks
> anton
> 
> -- 
> Anton Shterenlikht
> Room 2.6, Queen's Building
> Mech Eng Dept
> Bristol University
> University Walk, Bristol BS8 1TR, UK
> Tel: +44 (0)117 928 8233 
> Fax: +44 (0)117 929 4423


Try cp/rm -- <filename-with-dashes>
-- here denotes the end of command options.


HTH,
Yuri



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20090116103754.GA2317>