Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '14 at 2:36
up vote 2 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 '14 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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .