Linux 名称中带有反斜杠的Tar文件夹

Linux 名称中带有反斜杠的Tar文件夹,linux,tar,Linux,Tar,我试图归档一个名称中有几个反斜杠的目录。我的目录名是“\\abc\pqr\xyz”。这是我使用的命令 tar -czf abc.tar "\\\\abc\\pqr\\xyz" 我犯了这个错误 tar: \\abc\pqr\\xyz: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors 使用单引号。您可以使用echo进行测试: #!/bin/sh echo

我试图归档一个名称中有几个反斜杠的目录。我的目录名是“\\abc\pqr\xyz”。这是我使用的命令

tar -czf abc.tar "\\\\abc\\pqr\\xyz"
我犯了这个错误

tar: \\abc\pqr\\xyz: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors

使用单引号。您可以使用echo进行测试:

#!/bin/sh
echo "\\\\abc\\pqr\\xyz"
echo '\\\\abc\\pqr\\xyz'

试试单引号。