I accidentally created a file which name is a backslash \:
>ls -l
total 0
-rw-rw---- 1 user group 0 Jul 3 21:34 \
How do I delete it?
In order to pass a backslash in an argument to a command, you need to "quote" or "escape" it, which you can do either by wrapping it with single-quotes:
rm '\'
or by prefixing it with another backslash:
rm \\
(The same sort of thing is needed if you, say, have a file named *. To delete it, you would write rm '*' or rm \* or rm "*". And similarly for most other special characters.)
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