Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a tar(.gz) file created on a Linux system, and the filenames contain colon characters. The tar utilities I can find on Windows don't extract these files at all. How can I do this, ideally from the command-line?

If there's some way to do a filename-translation at the compression end, that would be ok too.

To make it clearer what I mean:

# on linux system
touch example:file
tar cvf test.tar example:file

# copy test.tar to windows system
tar xvf test.tar
... can't create 'example:file': Invalid argument
share|improve this question
    
Can you provide some examples and more details of what you tried and any specific errors you received? –  Eric G Mar 25 at 2:36

2 Answers 2

up vote 1 down vote accepted

7-zip extracts tars containing files with names containing colons. It replaces colons with underscores.

7-zip can be used also from command line, e.g.:

"c:\Program Files\7-Zip\7z.exe" x tar_containing_files_with_colons_in_names.tar
share|improve this answer
    
Thanks - that's a workable solution. –  xorsyst Mar 26 at 16:12

Colons are used to denote an alternate file stream in Windows. This may be causing the problem.

If you are able to echo the file you may be able to pipe it into your tar extractor. Also, since you will be extracting it, you may be able to rename it. If you are having trouble referencing the file with the full name, you may be able to use wildcard matching for the portion before the colon. e.g., if its something:else.tgz you maybe be able to reference it as something*, if there are not a lot of the same file.

One last things may be to see what the file's dos-short name is and reference using that instead of the full long name.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.