How to solve bash: syntax error near unexpected token ‘(‘ in Linux

Recently, in the development process, I want to delete a jar package on the server, but the name of the jar package is in parentheses
at the beginning, I deleted it like this:

rm -f HIBIKI_API(1).jar

But I got the following sentence:

bash: syntax error near unexpected token `(' 

Then I googled it and found that after linux5.0, you can’t use brackets. At this time, you need to translate. There are two ways of translation

1.rm -f HIBIKI_API\(1\).jar
2.rm -f "HIBIKI_API(1).jar"

In this way, the translation will be OK

Similar Posts: