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.