简体   繁体   English

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

[英]Tar folder with backslash in the name

I am trying to archive a directory which has several backslashes in the name. 我正在尝试归档名称中包含多个反斜杠的目录。 My directory name is "\\\\abc\\pqr\\xyz". 我的目录名称是“ \\\\ abc \\ pqr \\ xyz”。 Here is the command I used. 这是我使用的命令。

tar -czf abc.tar "\\\\abc\\pqr\\xyz"

I was getting this error. 我收到此错误。

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

Use single quotes. 使用单引号。 You can test with echo: 您可以使用echo进行测试:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM