Questions tagged [tar]

An archiving program for storing and retrieving files as a collection with support for data compression.

An archiving program for storing and retrieving files as a collection with support for data compression. It is mainly used for compacting multiple files into single one, for easy transporting or compression.

Its name comes from Tape ARchive

2690 questions
74
votes
4 answers

Deleting files after adding to tar archive

Can GNU tar add many files to an archive, deleting each one as it is added? This is useful when there is not enough disk space to hold both the entire tar archive and the original files - and therefore it is not possible to simply manually delete…
Ivy
  • 3,393
  • 11
  • 33
  • 46
71
votes
1 answer

How to create tar.gz archive file in Windows?

How to create tar.gz archive of my files in Windows to upload and extract in cPanel?
Shamas
  • 1,027
  • 2
  • 10
  • 10
69
votes
8 answers

How do I extract a tar file in Java?

How do I extract a tar (or tar.gz, or tar.bz2) file in Java?
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
65
votes
8 answers

Native .tar extraction in Powershell

I have a .tar.gz file that I need to extract. I've handled the gunzip bit with the GzipStream object from System.IO.Compression, but I couldn't find anything for dealing with tarballs in that namespace. Is there a way to deal with .tar files…
bfieck
  • 989
  • 1
  • 7
  • 17
64
votes
4 answers

How to send a compressed archive that contains executables so that Google's attachment filter won't reject it

I have a directory that I want to compress to send it by e-mail, I've tried this: tar -cvf filename.tar.gz directory_to_compress/ But when I try to send it by e-mail, Google says: filename.tar.gz contains an executable file. For security reasons,…
slackmart
  • 4,754
  • 3
  • 25
  • 39
63
votes
2 answers

How do I untar a subdirectory into the current directory?

How to I extract a subdirectory in a tarball into the current directory? Example, the tarball from…
Cory R. King
  • 2,766
  • 1
  • 24
  • 22
63
votes
1 answer

How to extract tar file in Mac terminal

As titled. I want to use some command, like for .zip files I can say unzip myfiles.zip -d mydirectory But is there a thing for .tar file on Mac as well?
nekodesu
  • 789
  • 1
  • 7
  • 10
63
votes
1 answer

How to extract tar archive from stdin?

I have a large tar file I split. Is it possible to cat and untar the file using pipeline. Something like: cat largefile.tgz.aa largefile.tgz.ab | tar -xz instead of: cat largefile.tgz.aa largfile.tgz.ab > largefile.tgz tar -xzf largefile.tgz I…
Charlie
  • 931
  • 1
  • 6
  • 10
62
votes
3 answers

Rename Directory Name Before tar Happens

I have a directory e.g. /var/tmp/my-dir/ that I frequently compress with the following command: $ cd /var/tmp/ $ tar -zcf my-dir.tar.gz my-dir/* Later, when I untar my-dir.tar.gz, it'll create my-dir/ in the current directory. It sounds like the…
moey
  • 10,587
  • 25
  • 68
  • 112
59
votes
10 answers

Tarballing without Git metadata

My source tree contains several directories which are using Git source control, and I need to tarball the whole tree excluding any references to the Git metadata or custom log files. I thought I'd have a go using a combination of…
zaf
  • 22,776
  • 12
  • 65
  • 95
58
votes
2 answers

Python packaging: wheels vs tarball (tar.gz)

The advantage of wheels over eggs is clear (see section why not egg? https://pypi.python.org/pypi/wheel). However, it is not entirely clear to me what is the advantage of using wheels over tar.gz. I might be missing something obvious like "they are…
zom-pro
  • 1,571
  • 2
  • 16
  • 32
56
votes
9 answers

How to install Go in alpine linux

I am trying to install Go inside an Alpine Docker image. For that I downloaded tar file from here inside my alpine docker image, untar it using following command: tar -C /usr/local -xzf go1.10.3.linux-amd64.tar.gz exported PATH to have go binary…
Yogesh Jilhawar
  • 5,605
  • 8
  • 44
  • 59
55
votes
6 answers

How to Compress/Decompress tar.gz files in java

Can anyone show me the correct way to compress and decompress tar.gzip files in java i've been searching but the most i can find is either zip or gzip(alone).
kdgwill
  • 2,129
  • 4
  • 29
  • 46
54
votes
9 answers

Extract tar the tar.bz2 file error

I tried to extract the tar.bz2 file in Fedora 17 OS. I used the command: # tar -xvjf myfile.tar.bz2 I received this error message: tar (child):bzip2: Cannot exec :Nosuch of file or directory tar (child): Error is not recoverable: exitng now tar:…
Vincent Huang
  • 543
  • 1
  • 4
  • 5
53
votes
3 answers

How to use Pigz with Tar

So I am using pigz in tar with tar --use-compress-program=pigz and this works but it doesn't use all of my processors, and I'd like to make sure it's recursive (-r) and using (-9 compression level). I read through Utilizing multi core for…
Cam
  • 545
  • 1
  • 4
  • 4