Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Looking for command-line UNIX-like 'tar' for Windows

by John M. Dlugosz (Monsignor)
on Jan 08, 2003 at 03:12 UTC ( #225152=perlquestion: print w/replies, xml ) Need Help??

John M. Dlugosz has asked for the wisdom of the Perl Monks concerning the following question:

In order to use the common Perl makefile distribution stuff, I need tar.exe and gzip.exe. I found gzip easily enough, as it has a home site with binaries for many platforms. But searching for "windows tar" on Google (and variations) just brings up pages that says "On windows system, try Winzip" or other alternatives on how to extract stuff from tarballs.

I want a command-line utility that uses all the same switches as the UNIX-inspired core Perl culture. But it should also work with native file names, so cygwin need not apply.

I guess I've never missed it because any GUI-based archive manager handles this format for reading anyway, and Perl stuff normally does its own management via the Archive::Tar module.


  • Comment on Looking for command-line UNIX-like 'tar' for Windows

Replies are listed 'Best First'.
Re: Looking for command-line UNIX-like 'tar' for Windows
by graff (Chancellor) on Jan 08, 2003 at 03:37 UTC

    Also, there's a very cool GNU cdrom, for just $35 (helps support, containing everything GNU-ish for windows: order your copy by selecting the large, bold "Ordering" link at -- look for:

    GNU Software for MS-Windows and MS-DOS with 150 page users manual. 2nd edition.

    Not just all the basic command-line utilities (find, awk, grep, sed, ls, rm, mv, cp, yadda-yadda), but also bash, gcc and a native windows version of emacs, and perl too -- gotta love it!

      The GNU Software book contains DJGPP ports which don't always work so well. (Long filename issues). Steve
        I'd be interested to hear about any specific examples (though I guess this may not be the best forum). Personally, I haven't encountered any such problems -- but then, I haven't tried pounding heavily on every utility...
Re: Looking for command-line UNIX-like 'tar' for Windows
by jsprat (Curate) on Jan 08, 2003 at 04:30 UTC
      Hey, perfect! Many thanks.


Re: Looking for command-line UNIX-like 'tar' for Windows
by perrin (Chancellor) on Jan 08, 2003 at 03:30 UTC
    I don't get it, why won't cygwin work? That's what I use.
      The reply from bbfu indicates I may have been wrong. But other cygwin tools I've seen, namely cdrecord, uses a UNIX file system emulation. It has to have forward slashes and no drive letter, and uses another utility to "mount" whatever top-level directories you plan to use into its own tree. That looked like it was central to the cygwin system.


        Well, yes, cygwin does create a unix filesystem emulation layer, but that doesn't mean filenames themselves are any different, just the paths. Perhaps I'm misunderstanding what you mean by "native filenames." Also, cygwin includes a cygpath command that will translate between the emulated unix filesystem paths and the native win32 paths.

        If your problem was with the unix filesystem emulation layer, however, it would probably be best for you avoid having to worry about translation and just look at one of the other suggestions made elsewhere in this thread. I also think the Perl Power Tools suggestion by jsprat sounds like a good idea.

        Black flowers blossum
        Fearless on my breath

        Wasn't your original question about using it with Perl's generated makefiles? Perl's build system should not have a problem with it.
Re: Looking for command-line UNIX-like 'tar' for Windows
by vek (Prior) on Jan 08, 2003 at 05:21 UTC
Re: Looking for command-line UNIX-like 'tar' for Windows
by seattlejohn (Deacon) on Jan 08, 2003 at 04:51 UTC
    There's also (GNU utilities for Win32), which aside from the tools themselves has a list of links to other places where you can find related tools, doc, etc.

    I think someone once told me that these tools are dated and that there's better stuff out there, but I've had no problem using tar in particular on one system where I'm often in a DOS box rather than under Cygwin.

            $perlmonks{seattlejohn} = 'John Clyman';

Re: Looking for command-line UNIX-like 'tar' for Windows
by agentv (Friar) on Jan 08, 2003 at 04:54 UTC
    ...I would weigh in heavily in favor of cygwin also.

    In addition to the archiving tools you seek (tar and gzip) it also comes with a distribution of perl, an instance of bash, wget, ssh, and XFree86. I have been using cygwin since the day I was burdened with Windows98 and I couldn't work in the Win32 environment without it.

    I can't quite make out what you mean by "native filenames." WinDos will ignore case differences in filenames, but GNU tar under cygwin respects case differences just fine. That's about the only issue I could imagine unless you actually want a utility that preserves the myfile~1.doc filenaming convention.

    ...All the world looks like -well- all the world, when your hammer is Perl.

(mingw / msys) Re: Looking for command-line UNIX-like 'tar' for Windows
by bbfu (Curate) on Jan 08, 2003 at 03:47 UTC

    I also don't understand why cygwin won't work for your purposes, as it works fine with MS Windows "native" file names, but you could check out MinGW's MSYS. It includes both tar and gzip, among others. (Disclaimer: I haven't actually used MSYS.)

    Black flowers blossum
    Fearless on my breath

Re: Looking for command-line UNIX-like 'tar' for Windows
by traveler (Parson) on Jan 08, 2003 at 13:46 UTC
    If your tar file is in POSIX format, you can use the native tar in Windows (at least 2000 and 98). Yes, pax supports tar and cpio. I have used it successfully. I only have 2000 where I am right now, but it seems to work OK. You have to use Windows help to get the help. The /? does not work...

    HTH, --traveler

Re: Looking for command-line UNIX-like 'tar' for Windows
by gmpassos (Priest) on Jan 08, 2003 at 18:14 UTC
    tar.exe works very well! Here are a link with "GNU utilities for Win32" on SF:

    From the site: "native means the executables do only depend on the Microsoft C-runtime (msvcrt.dll) and not an emulation layer like that provided by Cygwin "

    This version of tar and gzip work for me. Enjoy ;-P

    Graciliano M. P.
    "The creativity is the expression of the liberty".

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://225152]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2023-03-21 10:24 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.