Thursday 26 December 2019

unix - What command do I need to use to remove a file called `-rf`?


I did something crazy at some point that created a file called -rf on my filesystem.
Now I can't figure out how to delete it...


I've tried:


rm "-rf"
rm \-rf

These just exit immediately, arrgh!


Anyone know how to remove this file? Preferably without accidentally cleaning out my whole folder.



Answer



unlink -rf

Or


rm -- -rf

No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...