Is this a valid file name 1.abc!``!+123
in Ubuntu?
I issued the command
rm 1.abc!``!+123
and got error message
-bash: !``!+123: event not find
Why? How to I delete the file?
Is this a valid file name 1.abc!``!+123
in Ubuntu?
I issued the command
rm 1.abc!``!+123
and got error message
-bash: !``!+123: event not find
Why? How to I delete the file?
Just simply
rm '1.abc!``!+123'
. Note about'
Note:Quoting is used to remove the special meaning of certain characters or words to the shell. Quoting can be used to disable special treatment for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion. Some special characters are: $ ` " !
Yes, that is a valid file name. However, the shell treats those as special characters, so to use them in a file command, you will need to escape them using
'
:According to the bash manpage,
And
So if you want to use the
!
or`
characters as regular characters, you need to escape them using'
so the shell doesn't try to start a history or command substitution.