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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to delete a file named -x

Reply to Message Icon

Name: pkm_icf
Date: June 18, 2002 at 03:20:20 Pacific
Comment:

Pl hlp how to delete a file named -x



Sponsored Link
Ads by Google

Response Number 1
Name: frank
Date: June 18, 2002 at 03:53:13 Pacific
Reply:

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


0

Response Number 2
Name: frank
Date: June 18, 2002 at 03:54:36 Pacific
Reply:

Hi again,

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

rm SPACE - SPACE -x

Regrads Frank


0

Response Number 3
Name: LANkrypt0
Date: June 18, 2002 at 06:37:43 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: How to delete a file named -x

way to remove a file named -l ? www.computing.net/answers/unix/way-to-remove-a-file-named-l-/4071.html

How to delete a file that starts with hyphen www.computing.net/answers/unix/how-to-delete-a-file-that-starts-with-hyphen/8436.html

how to get a process name ? www.computing.net/answers/unix/how-to-get-a-process-name-/3945.html