SCP path contains special characters Error [How to Solve]

Question

From a file on the local copy server, use the following command:

scp root@xx.xx.xx.xx:/home/test/files(202110~202111).xls .

Error reporting:
bash: – C: line 0: syntax error near unexpected token ` (‘

Solution:

    1. enclose the entire path in single quotation marks;
  1. before the parentheses, add the escape character
scp root@xx.xx.xx.xx:'/home/test/files\(202110~202111\).xls' .

Read More: