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?