>> I've got an idiot user who has created a file on a Linux filesystem named
>>
>> -.mxf
>>
>> I need to rename this file, but can't for the life of me remember how
>> to escape the - character so mv doesn't regard it as an "option"
>> identifier.
>
> Insert "./" in front of it so mv doesn't see the "-" at the beginning
> of the string and tries to interpret it as a flag.
>
> So the command could be "mv ./-.mxf newname.mxf".

Another way that you may find handy in the future when using system
utilities is the -- argument eg: "rm -- -filname".  The example
removes the file "-filename".  The argument -- often signifies end of
arguments, and anything after that is translated as non-arguments to
the command.  It's used quite a bit in GNU tools, and I'd guess maybe
more tools.

Chris-
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to