The !
symbol must be quoted to prevent history expansion. It has many other usage under bash. Hence, Try any one of the following command-line syntax to delete and remove file named with special symbols in it:
rm -v -i ./\!
OR
rm -i -v -- '/path/to/!'
You will see message as follows:
rm: remove regular empty file '/path/to/!'?
Where rm options are as follows:
-
-i
: prompt before every removal -
-v
: verbose output
See the following tutorial for more info:
And: