How to remove a file with a dash as first character?

If you accidentally created a file with a - in the beginning then you want to
remove it, you have to do :
rm ./-thefile

Comments

Igor said…
Thank you. Exactly what I was looking for!
JTP said…
Thank you! No amount of backslashing seems to work.
Anonymous said…
Thanks - exactly what I needed!
Unknown said…
thank you , I was looking for it.
Tim said…
Absolute magic
Anonymous said…
Thank you!!!
Anonymous said…
And if you have a file like this: "--exclude", you can delete it like this:
rm ./--exclude
Anonymous said…
Th-thanks
James said…
Awesome, you saved my life...

Popular posts from this blog

How do I Use the Linux Top Command?

IOPS measurement