Difference between revisions of "How to unpack a tar file in Windows"

From HaskellWiki
Jump to navigation Jump to search
(New page)
 
m (Henk-Jan van Tuyl moved page How to unpack a tar file in windows to How to unpack a tar file in Windows: Capitalization of Windows)
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  +
= Introduction =
# Download and install 7zip from [http://www.7-zip.org/].
 
  +
Source code is often packed for download as a TAR (Tape ARchive) file, that is a standard format in the Unix/Linux world. These files have a <tt>.tar</tt> extension; they can also be compressed, the extension is <tt>.tar.gz</tt> or <tt>.tar.bz2</tt> in these cases. There are several ways to unpack these files.
# Add the directory you installed 7zip into to your path (Start -> Control Panel -> System -> Advanced -> Environment Variables).
 
  +
  +
  +
= tar =
  +
If you have MinGW/MSYS or Cygwin installed, you can use the <tt>tar</tt> command to unpack such files:
  +
tar xvf <.tar file>
  +
tar xzvf <.tar.gz file>
  +
tar xjvf <.tar.bz2 file>
  +
See the [http://unixhelp.ed.ac.uk/CGI/man-cgi?tar tar man page] for more information.
  +
  +
  +
= 7-Zip =
  +
Another option is to install 7-Zip, which has a nice graphical user interface. 7-Zip can also be used to unpack many other formats and to create tar files (amongst others).
  +
  +
# Download and install 7-Zip from [http://www.7-zip.org/ 7-zip.org]. If you do not want to use 7-Zip as a command line tool, skip the next steps.
 
# Add the directory you installed 7-Zip into to your path (Start -> Control Panel -> System -> Advanced -> Environment Variables).
 
# Move the tar file to the directory you wish to unpack into (usually the tar file will put everything into a directory inside this directory).
 
# Move the tar file to the directory you wish to unpack into (usually the tar file will put everything into a directory inside this directory).
 
# Open a command prompt, and cd to the directory.
 
# Open a command prompt, and cd to the directory.
  +
# If the tar file is compressed, type <tt> 7z x ''filename.tar.gz''</tt> at the command prompt (where <tt>''filename.tar.gz''</tt> is the name of the compressed tar file). This results in a tar file called <tt>''filename.tar''</tt>
 
# Type <tt> 7z x ''filename.tar''</tt> at the command prompt (where <tt>''filename.tar''</tt> is the name of the tar file).
 
# Type <tt> 7z x ''filename.tar''</tt> at the command prompt (where <tt>''filename.tar''</tt> is the name of the tar file).
  +
  +
Instead of using 7-Zip on the command line, you can use the file manager and click on a <tt>.tar</tt>, <tt>.tar.gz</tt>, or<tt>.tar.bz2</tt> file; 7-Zip will automatically start.
  +
  +
= TarTool =
  +
  +
A simple windows command line tool (no install , just unzip)
  +
  +
Its hosted on codeplex [http://tartool.codeplex.com/ tartool], complete with the source code.
  +
  +
#to decompress and untar .tar.gz (.tgz) files or
  +
#just untar .tar files
  +
  +
>TarTool.exe
  +
  +
Usage :
  +
  +
>TarTool sourceFile destinationDirectory
  +
  +
>TarTool D:\sample.tar.gz ./
  +
  +
>TarTool sample.tgz temp
  +
  +
>TarTool -x sample.tar temp
  +
  +
TarTool 2.0 Beta supports bzip2 files such as tar.bz2 and .bz2 extraction.
  +
  +
TarTool -xj sample.tar.bz2 temp
  +
or
  +
TarTool -j sample.bz2
  +
  +
More details are on this post -- http://blog.rajasekharan.com/2009/01/16/tartool-windows-tar-gzip-tgz-extraction-tool/

Revision as of 13:35, 10 December 2013

Introduction

Source code is often packed for download as a TAR (Tape ARchive) file, that is a standard format in the Unix/Linux world. These files have a .tar extension; they can also be compressed, the extension is .tar.gz or .tar.bz2 in these cases. There are several ways to unpack these files.


tar

If you have MinGW/MSYS or Cygwin installed, you can use the tar command to unpack such files:

  tar xvf  <.tar file>
  tar xzvf <.tar.gz file>
  tar xjvf <.tar.bz2 file>

See the tar man page for more information.


7-Zip

Another option is to install 7-Zip, which has a nice graphical user interface. 7-Zip can also be used to unpack many other formats and to create tar files (amongst others).

  1. Download and install 7-Zip from 7-zip.org. If you do not want to use 7-Zip as a command line tool, skip the next steps.
  2. Add the directory you installed 7-Zip into to your path (Start -> Control Panel -> System -> Advanced -> Environment Variables).
  3. Move the tar file to the directory you wish to unpack into (usually the tar file will put everything into a directory inside this directory).
  4. Open a command prompt, and cd to the directory.
  5. If the tar file is compressed, type 7z x filename.tar.gz at the command prompt (where filename.tar.gz is the name of the compressed tar file). This results in a tar file called filename.tar
  6. Type 7z x filename.tar at the command prompt (where filename.tar is the name of the tar file).

Instead of using 7-Zip on the command line, you can use the file manager and click on a .tar, .tar.gz, or.tar.bz2 file; 7-Zip will automatically start.

TarTool

A simple windows command line tool (no install , just unzip)

Its hosted on codeplex tartool, complete with the source code.

  1. to decompress and untar .tar.gz (.tgz) files or
  2. just untar .tar files

>TarTool.exe

Usage :

>TarTool sourceFile destinationDirectory

>TarTool D:\sample.tar.gz ./

>TarTool sample.tgz temp

>TarTool -x sample.tar temp

TarTool 2.0 Beta supports bzip2 files such as tar.bz2 and .bz2 extraction.

TarTool -xj sample.tar.bz2 temp or TarTool -j sample.bz2

More details are on this post -- http://blog.rajasekharan.com/2009/01/16/tartool-windows-tar-gzip-tgz-extraction-tool/