Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is this a valid file name!``!+123 in Ubuntu?

I issued the command


and got error message

-bash: !``!+123: event not find

Why? How to I delete the file?

share|improve this question
up vote 8 down vote accepted

Just simply rm '!``!+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: $ ` " !

share|improve this answer
The ! invokes the Bash history expansion so it has to be protected by quotes or a preceding `` – Florian Diesch Mar 1 '13 at 17:51

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 ':

rm '!``!+123'

According to the bash manpage,

! Start a history substitution, except when followed by a blank, newline, carriage return, = or ( (when the extglob shell option is enabled using the shopt builtin).


Command Substitution

Command substitution allows the output of a command to replace the command name. There are two forms:




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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.