Reputation: 1361
I am trying to archive a directory which has several backslashes in the name. My directory name is "\\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
Upvotes: 0
Views: 600
Reputation: 44250
Use single quotes. You can test with echo:
#!/bin/sh
echo "\\\\abc\\pqr\\xyz"
echo '\\\\abc\\pqr\\xyz'
Upvotes: 1