How do I delete a file named "-p" from bash?
Most GNU tools support --
to terminate the options.
rm -- -p
rm ./-p
The NOTE
section in the man page for rm
has something to say exactly about this. Apart from what Ignacio Vazquez-Abrams has mentioned in their answer, one other way of removing such files, as mentioned in the man page, is by using an absolute path reference, such as: rm /home/user/-p
.