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
52
votes
2 answers

How can I read tar.gz file using pandas read_csv with gzip compression option?

I have a very simple csv, with the following data, compressed inside the tar.gz file. I need to read that in dataframe using pandas.read_csv. A B 0 1 4 1 2 5 2 3 6 import pandas as…
Geet
  • 2,515
  • 2
  • 19
  • 42
50
votes
3 answers

Shell 'tar: not found in archive' error when using regular expression

When I use tar -xzf *.gz to extract all the .gz files in the current directory, I get Not found in archive error. However, it works fine if I extract one by one or use a for-loop like for file in `ls *.gz`; do tar -xzf $file; done What is the…
notbad
  • 2,797
  • 3
  • 23
  • 34
48
votes
4 answers

Docker load and save: "archive/tar: invalid tar header"

I'm trying to import a Docker image into Docker on AWS Red Hat Linux (3.10.0-514.el7.x86_64) and am having problems with the error; Error processing tar file(exit status 1): archive/tar: invalid tar header This same image works fine on my local…
bicster
  • 740
  • 3
  • 9
  • 18
47
votes
8 answers

Opening a .tar.gz file with a single command

When I download a .tar.gz file, I open it with two commands, first gunzip and then tar. Is it possible to open it with just one command?
flybywire
  • 261,858
  • 191
  • 397
  • 503
47
votes
2 answers

what does -zxvf mean in tar -zxvf ?

I have seen on many websites commands like this what does the "-zxvf" or the similar commands stand for? tar -zxvf tar xvf
Shikhar
  • 699
  • 1
  • 6
  • 7
46
votes
4 answers

How to fix 'tar: Failed to set default locale' error?

I'm trying to install a package into R, something I swore on my blood never to do, yet here I am. The command supposedly goes: install.packages('NCStats',,'http://www.rforge.net/')` while I am enjoying the healthy dose of: Warning: dependencies…
gakera
  • 3,589
  • 4
  • 30
  • 36
43
votes
8 answers

tar: Error is not recoverable: exiting now

when I untar doctrine -rw-r--r-- 1 root root 660252 2010-10-16 23:06 Doctrine-1.2.0.tgz I always get this error messages root@X100e:/usr/local/lib/Doctrine/stable# tar -xvzf…
udo
  • 4,832
  • 4
  • 54
  • 82
43
votes
2 answers

How to construct a TarFile object in memory from byte buffer in Python 3?

Is it possible to create a TarFile object in memory using a buffer containing the tar data without having to write the TarFile to disk and open it up again? We get the bytes sent over a socket. Something like this: import tarfile byte_array =…
Sefu
  • 2,404
  • 8
  • 42
  • 59
43
votes
5 answers

Extract files contained in archive.tar.gz to new directory named archive

I have a directory containing about 800 .tgz archives, each containing about 10 files. Effectively, I want to convert each archive into a directory of the same name. Is there a simple one line command to do this, or should I write a script?
si_2012
  • 649
  • 1
  • 6
  • 11
43
votes
12 answers

How to compare two tarball's content

I want to tell whether two tarball files contain identical files, in terms of file name and file content, not including meta-data like date, user, group. However, There are some restrictions: first, I have no control of whether the meta-data is…
myjpa
  • 433
  • 1
  • 4
  • 7
42
votes
2 answers

How to create a tar file that omits timestamps for its contents?

Is there a way to create a .tar file that omits the values of atime/ctime/mtime for its files/directories? Why do we want to do this? We have a step in our build process that generates a directory of artifacts that gets packaged into a tarfile. We…
Mickalot
  • 2,431
  • 3
  • 22
  • 23
41
votes
7 answers

python write string directly to tarfile

Is there a way to write a string directly to a tarfile? From http://docs.python.org/library/tarfile.html it looks like only files already written to the file system can be added.
gatoatigrado
  • 16,580
  • 18
  • 81
  • 143
40
votes
4 answers

How to fix NPM package Tar, with high vulnerability about Arbitrary File Overwrite, when package is up to date?

I just installed Flickity from NPM and got an NPM Audit Security Report after running npm audit stating that I have a high vulnerability issue regarding Arbitrary File Overwrite on package tar which is a dependency of node-sass as you can see…
Wilbert Caba
  • 530
  • 1
  • 6
  • 13
40
votes
4 answers

How do I exclude absolute paths for tar?

I am running a PHP script that gets me the absolute paths of files I want to tar up. This is the syntax I have: tar -cf tarname.tar -C /www/path/path/file1.txt /www/path/path2/path3/file2.xls When I untar it, it creates the absolute path to the…
Angel S. Moreno
  • 3,469
  • 3
  • 29
  • 40
40
votes
5 answers

Programmatically extract tar.gz in a single step (on Windows with 7-Zip)

Problem: I would like to be able to extract tar.gz files in a single step. This makes my question almost identical to this one: Stack Overflow question for tar-gz. My question is almost the same, but not the same, because I would like to do this on…
dreftymac
  • 31,404
  • 26
  • 119
  • 182