I'm trying to extract a tarball using tar -xvf that's in the format (where * is any word character) *@*@*@*.tar.gz but I think tar is trying to find the file at a remote location. The error I get is for the command tar -xzvf tasf423@2012-02-22\@00:03:04\@ja41nf.tar.gz:

tar (child): Cannot connect to 2012-02-22@00: resolve failed

I tried using back slashes to escape it and even tried replacing the @ symbols with %40 but none of this seemed to work. Is there any way to extract a tarball using the tar command with an @ in its name?

  • Did you try double quotes around the file name? tar -xvf "@*@.tar.gz" – Diego Feb 25 '12 at 3:09
  • Yeah, still didn't work. I'm running the command with a perl script using a system command so I don't think that's the problem, but when I try quotes in command line it still fails. tar: Cannot connect to 2012-02-22@00: resolve failed – Redian Feb 25 '12 at 3:12

The problem is the colons, not the at signs. Use --force-local.

  • I think that's it too. Linux is trying to connect to a remote server because of it. +1 – Yanick Girouard Feb 25 '12 at 3:22
  • Yup! That was it! I was thinking of the ssh user@host:path syntax and figured it saw the @ first. force-local worked though. Thank you! – Redian Feb 25 '12 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy