Computing.Net > Forums > Unix > How to delete a file named -x

How to delete a file named -x

Reply to Message Icon

Original Message
Name: pkm_icf
Date: June 18, 2002 at 03:20:20 Pacific
Subject: How to delete a file named -x
Comment:

Pl hlp how to delete a file named -x


Report Offensive Message For Removal


Response Number 1
Name: frank
Date: June 18, 2002 at 03:53:13 Pacific
Subject: How to delete a file named -x
Reply: (edit)

hi,

a lot of possibility depending on which os.
you can do rm - -x
rm -i * {and confirm only the -x file }

No RISK no fun

Regards Frank


Report Offensive Follow Up For Removal

Response Number 2
Name: frank
Date: June 18, 2002 at 03:54:36 Pacific
Subject: How to delete a file named -x
Reply: (edit)

Hi again,

only to make sure that you see the amount of spaces.

rm SPACE - SPACE -x

Regrads Frank


Report Offensive Follow Up For Removal

Response Number 3
Name: LANkrypt0
Date: June 18, 2002 at 06:37:43 Pacific
Subject: How to delete a file named -x
Reply: (edit)

Taken directly from the man pages of rm
> man rm

Users often wonder how to deal with filenames that begin with ``-'', since arguments that begin with ``-'' are usually treated as flags. The special argument ``--'' tells programs not to interpret following arguments as flags. (This is also the case for most system utilities.) Thus, to delete a file named ``-foo'', type:
rm -- -foo


So the short answer:
rm -- -x


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: How to delete a file named -x

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge