Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

migrated from stackoverflow.com Feb 27 '12 at 0:04

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 8 down vote accepted

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

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.