SUMMARY: Remove or rename a file

From: Safdar Mirza <>
Date: Thu Mar 02 2006 - 17:39:21 EST
My sincere apology to those who suggested that I should not post a unix
related question to Solaris Sun Manager list.

Special thanks to *Richard Lacroix, Scott Fendley, Simon Burr, Lineberger,
Aaron., Bill R. Williams, Thomas M. Payerle, Alexandre Wanderley  *Following
solutions were provided.

My original question.

Hi Sun Mgr -

This seems like a very simple problem but I can not find a solution for
this.  After reading several man pages, trying google and different options
I finally decide to ask.

I have few files that start with - as file name. I want to rename them but I
can not find a simple solution.  File are listed as follows:




cp or mv or even ls does not work as all commands assume that - is a flag
and not a file name.  I have tried double quote "", single quote  ''. or
even backslash \ before the - character but none of them work. Any
other ideas?   Thanks.

:) Safdar

And answer to my question:

ls - -work*
mv - -work.file01 work.file01

rm - -work.file01

mv ./-work.file01 work.file01

rm -- -work.file01

Safdar Mirza
sunmanagers mailing list
Received on Thu Mar 2 17:39:52 2006

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:56 EST