Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?

Like an idiot, I ran this command:

 tar -cf -X awstats-icon icon tarfile.tar . 

I was trying to use the -X switch to exclude awstats-icon and icon directories.

Now I have a large file named -X and I cannot seem to delete it. I tried using:

 rm -X rm `-X` rm '-X' 

However none of these have worked. Any suggestions?

Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?

Like an idiot, I ran this command:

 tar -cf -X awstats-icon icon tarfile.tar . 

I was trying to use the -X switch to exclude awstats-icon and icon directories.

Now I have a large file named -X and I cannot seem to delete it. I tried using:

 rm -X rm `-X` rm '-X' 

However none of these have worked. Any suggestions?

Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?

Like an idiot, I ran this command:

 tar -cf -X awstats-icon icon tarfile.tar . 

I was trying to use the -X switch to exclude awstats-icon and icon directories.

Now I have a large file named -X and I cannot seem to delete it. I tried using:

 rm -X rm `-X` rm '-X' 

However none of these have worked. Any suggestions?

insert duplicate link
Source Link

Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?

Like an idiot, I ran this command:

 tar -cf -X awstats-icon icon tarfile.tar . 

I was trying to use the -X switch to exclude awstats-icon and icon directories.

Now I have a large file named -X and I cannot seem to delete it. I tried using:

 rm -X rm `-X` rm '-X' 

However none of these have worked. Any suggestions?

Like an idiot, I ran this command:

 tar -cf -X awstats-icon icon tarfile.tar . 

I was trying to use the -X switch to exclude awstats-icon and icon directories.

Now I have a large file named -X and I cannot seem to delete it. I tried using:

 rm -X rm `-X` rm '-X' 

However none of these have worked. Any suggestions?

Possible Duplicate:
How do I delete a file whose name begins with “-” (hyphen a.k.a. dash or minus)?

Like an idiot, I ran this command:

 tar -cf -X awstats-icon icon tarfile.tar . 

I was trying to use the -X switch to exclude awstats-icon and icon directories.

Now I have a large file named -X and I cannot seem to delete it. I tried using:

 rm -X rm `-X` rm '-X' 

However none of these have worked. Any suggestions?

Post Closed as "exact duplicate" by Mat, Caleb, Michael Mrozek
Tweeted twitter.com/#!/StackUnix/status/156517395970801665
Post Migrated Here from serverfault.com (revisions)
Source Link
Charles Chadwick
Charles Chadwick

Accidently created a file called -X, how can I delete it?

Like an idiot, I ran this command:

 tar -cf -X awstats-icon icon tarfile.tar . 

I was trying to use the -X switch to exclude awstats-icon and icon directories.

Now I have a large file named -X and I cannot seem to delete it. I tried using:

 rm -X rm `-X` rm '-X' 

However none of these have worked. Any suggestions?