This question states:
It is amazing how many users don't know about the
rm ./-rf
orrm -- -rf
tricks.
I am afraid to try these, but curious as to what they do. They are also very difficult to search...
Can someone enlighten me?
rm ./-rf
and/or rm -- -rf
would attempt to remove a file named, specifically, -rf
The only trick here is that you normally can't delete a file that starts with a "-" because the command will assume it's a command argument. By preceding the file with a full path, or using the --
option (which means, end all options) the command will no longer assume it's an argument.
It should be noted that the --
version of this trick may or may not work with all shell commands either, so it's best to use the first version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With