The tar archive format and/or the command-line utility for working with tar files.

learn more… | top users | synonyms

18
votes
2answers
26k views

scp and compress at the same time, no intermediate save

What is the canonical way to: scp a file to a remote location compress the file in transit (tar or not, single file or whole folder, 7za or something else even more efficient) do the above without ...
3
votes
2answers
10k views

Create target directory when extracting tarball

Is it possible to create a target directory, similar to mkdir -p, where I can define a non-existent target directory within my tar command, and tar will create the directory for me? I know I can ...
7
votes
4answers
113 views

How can I filter the contents of a tar file, producing another tar file in the pipe?

Consider a single tar file from an external system which contains some directories with various attributes which I want to retain such as permissions, mtimes, etc. How can I easily take a subset of ...
4
votes
1answer
34 views

Install powernap on debian?

I just read about powernap here but don't know how to install it.. Download and untar was simple: axel https://launchpad.net/powernap/trunk/2.20/+download/powernap_2.20.orig.tar.gz && tar ...
3
votes
2answers
764 views

Copy just permissions and ownership from one tar file to another

I have two tar files which are basically backups of my /data folder on android. The problem is the permissions and ownership of the files inside latest back-up is messed up. However the permissions in ...
6
votes
2answers
365 views

How to use tar to compress a group of files in a .txt file?

I have a lot of filenames that listed in a .txt file called to_be_archived_files.txt, and its content is as: ~/Documents/dir1/a.html ~/Documents/dir1/b.html ~/Documents/dir1/c/1.html How do I add ...
3
votes
2answers
34 views

Archiving to remote-machine with tar/cpio and ssh?

I'm renting a couple of VPS with Ubuntu, and I've managed to fill-up one of them. Here I've got several directories with lots of files I'd like to put into an archive. Unfortunately, I don't have ...
1
vote
1answer
681 views

linux tar listed-incremental untrustworthy

I'm looking for some way to troubleshoot incremental backups with tar on linux. I've got huge datasets (about 3TB) that need backing up to tape. For this I use the linux tar command and mt / mtx on ...
-2
votes
3answers
439 views

find command and tar

find /informatica/dev/SrcFiles* -mtime +7 -and -size +1M -exec tar -cvjf> So I ran this command and I can't find the file after it was done running (probably because I never named it?). The ...
5
votes
7answers
12k views

tar files only, no directories

I can probably write a shell script to find files only, then pass the list to tar, but I am wondering whether there already is a built-in feature in tar that allows doing just that, in a single ...
1
vote
1answer
40 views

How to create a tar of a chroot?

I want to capture everything in a chroot but am unsure whether I need to first chroot into it to see the full filesystem/preserver permissions etc. From outside the chroot, it seems like I would miss ...
1
vote
1answer
15 views

creating a xar archive using the tar utility in FreeBSD

I am trying to create a xar archive using the tar utility in FreeBSD tar -c -f test --format xar index.html I get the following error Can't use format xar: Xar not supported on this platform How ...
2
votes
1answer
50 views

Where the term “tarball” comes from?

I use unix distros every day and I started using them a long time ago but I never thought about the provenience of the word "tarball". I tried to search it on the dictionary but I didn't find ...
3
votes
2answers
448 views

How to install BPG (Better Portable Graphics) on Linux Mint 17?

How do I install BPG (Better Portable Graphics) on Linux Mint 17? I downloaded the tar.gz file from Fabrice Bellard's website. The ReadMe file says, Edit the Makefile to change the compile ...
19
votes
6answers
11k views

Is there a parallel file archiver (like tar)?

Is there something out there for parallel archiving of files? Tar is great, but I don't use tape archives, and it's more important to me that the archiving happens quickly (with compression like ...
6
votes
7answers
176 views

Unix : how to tar only N first files of each folder?

I have a folder containing 2Gb of images, with sub-folders several levels deep. I'd like to archive only N files of each (sub) folder in a tar file. I tried to use find then tail then tar but ...
24
votes
7answers
55k views

tar --exclude doesn't exclude. Why?

I have this very simple line in a bash script which executes successfully (i.e. producing the _data.tar file), except that it doesn't exclude the sub-directories it is told exclude via the --exclude ...
1
vote
3answers
9k views

tar: Unexpected EOF in archive

I am trying extract .tar.gz file it but with no luck gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now the ...
2
votes
1answer
136 views

Why I can't unpack .tar.bz2 or .tar.xz files?

I'm having a problem unpacking files when I try to build from source on my OpenBSD, first I though it was just corrupted files but after it happened to many different programs and from different ...
19
votes
4answers
4k views

Does tar actually compress files, or just group them together?

I usually assumed that tar was a compression utility, but I am unsure, does it actually compress files, or is it just like an ISO file, a file to hold files?
1
vote
0answers
34 views

Using tar to backup and restore a path mounted with overlayfs

I have a system running OpenWRT with Linux 2.6.39.2. In my filesystem, I have symlinks contained in /etc/rc.d on ROM and more symlinks contained in /overlay/etc/rc.d in flash. overlayfs does a union ...
-1
votes
1answer
34 views

how to untar a file in Ubuntu? [closed]

Whenever I am writing this: tar - xvf grads-2.0.2.oga.2-bundle.tar.gz I am getting this: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options How to use this?
1
vote
1answer
59 views

XZ - Cannot allocate memory

If i run this command: XZ_OPT=-9 tar --xz -cvf files/compressed/xz/archive.tar.xz -C files/original/ . Get this message: xz: (stdin): Cannot allocate memory tar: ...
0
votes
1answer
28 views

Set LZMA compression level via tar [duplicate]

How can I set the compression level for this command? tar --lzma -cf files/compressed/lzma/archive.lzma -C files/original/ . With --bzip I just use: BZIP2=-9 tar --bzip2 -cf ...
26
votes
3answers
69k views

Add/update a file to an existing tar.gz archive?

Is there a way to add/update a file in a tar.gz archive? Basically, I have an archive which contains a file at /data/data/com.myapp.backup/./files/settings.txt and I'd like to pull that file from the ...
2
votes
1answer
39 views

Output file generated by tar

tar can be used to gather a whole directory into a single file. I tried with the sample directory sampledir containing just some text files, with no subdirectories. Originally the directory occupies ...
0
votes
2answers
65 views

How to determine where a tarball expanded

I ran the following on Redhat linux: tar zxvf jdk-7u79-linux-x64.tar.gz resulting in: jdk1.7.0_79/ jdk1.7.0_79/LICENSE jdk1.7.0_79/release jdk1.7.0_79/jre/ jdk1.7.0_79/jre/LICENSE ...
4
votes
2answers
47 views

Can I store and work with a directory in compressed form?

I have to work with many large sized directories which are shipped around in the form of tarballs. However, in order to really do any operations these tarballs have to be untarred into directories and ...
0
votes
3answers
35 views

How to delete files from a directory based on the contents of a gzipped tar file?

Given that I: have a directory that contains over 1000 files have a gzip'ed tar file that contains a subset of those files (x.tgz) What is the single command line (if it is possible) that will ...
1
vote
1answer
54 views

tar in parallel [duplicate]

I have a directory with several hundred sub-directories. I want to tar and compress each sub-directory and name the resulting file <currentDirName>.tar.bz2. I have done: find ./dir -type f ...
1
vote
1answer
44 views

tar ignoring “newer” option

How do I get tar to only include files newer than a certain date? I have tried the following, both of which include older and newer files (today is 2015-07-20): tar -cj -N 2015-07-07 directory | tar ...
8
votes
3answers
401 views

Pack file with tar.gz from root directory

I try to pack a .csv file with tar.gz, while being in the root directory. The file myfile.csv is located at /mnt/sdb1/ So the full filename is /mnt/sdb1/myfile.csv I try to save the tar.gz under ...
3
votes
2answers
37 views

create flat tar archive: ignoring all parents when adding folders

I want to add few folders (recursively) to a new tar archive. All folders should be at the root level of the resulting archive. Is there any way to add all folders without their parents, and without ...
3
votes
2answers
335 views

unable to back-up data from android tablet to laptop using tar!

I'm using tar to back-up data from my android tablet to laptop. But it is showing some error. ravbholua@ravbholua-Aspire-5315:/run/user/ravbholua/gvfs/mtp:host=%5Busb%3A002%2C003%5D/65537/9$ tar -cvf ...
2
votes
1answer
30 views

How to tar-bzip old files in yearly groups

I wish to know a command I can use to grab and archive all files for a year at a time. I am working on a directory that has 72000 files, with files dated from 2007 to current. And I wish to make that ...
1
vote
2answers
27 views

tar extract hangs on non-existent file

I tried to extract a valid tar gzip file, P.tgz. It hangs infinitely. tar -x P.tgz This archive is of very small size. But it never gets completed. I tried with a non-existent tar archive, ...
3
votes
4answers
405 views

Is it possible to make a .tar.gz file directly from stdin? Or, I need to tar together already gzipped files

I'm going to tell you exactly what I need in order to clarify the cryptic question in the title. I'm currently making scheduled MySQL backups of all my databases with something like: mysqldump ... | ...
9
votes
3answers
1k views

Is there a way to convert a zip to a tar without extracting it to the filesystem?

Is there a way to convert a zip archive to a tar archive without extracting to a temporary directory first? (and without writing my own implementation of tar or unzip)
0
votes
1answer
63 views

Can I use lzma compression, without using “tar”, on OSX 10.10.3?

I kind of think of OSX as Unix by another name. But, if I need to move this to the Apple forum, please tell me! I can create tar files compressed using lzma as such: $ ls ./DbDumps alpha.dmp ...
1
vote
2answers
22 views

Include subdirectory from excluded directory in a tar archive

I have the root folder USA and sub-folders California and Texas. Texas is an excluded sub-folder but it has a specific file in it that I'd like to include in the tar backup. Let's call this file ...
4
votes
1answer
59 views

How can I repair a tar file where stderr got mixed with stdout?

I have a tar file that I'm trying to repair. The problem is that tar's stderr got mixed in with its stdout, so the file looks like this: % head android-1435613730.tar tar: removing leading '/' from ...
2
votes
0answers
30 views

Recover corrupt tarball

I have a corrupt tarball on my hands. My first attempt at recovery went like this: $ tar --ignore-failed-read --ignore-command-error -xf tarball.tar tar: Skipping to next header tar: Archive contains ...
0
votes
2answers
44 views

Tar - exclude all files in sub folder but not nested folders

I need to create a .tgz archive of the following folder pack | rest | vendor (folder) | ----index.php | ----info.log | another (folder) | ---index.php ...
7
votes
3answers
405 views

Can tarring files improve compression?

Can tarring a bunch of files together improve compression with the standard tools, e.g. gzip, bzip2, xz? I've long thought this to be the case but never tested it out. If we have 2 copies of the same ...
2
votes
1answer
148 views

'Tar' the result of a 'find', preserving the directory structure

I want to tar all the *.txt files that I get as the result of a find command, that exist in a directory having a tree structure like this: Directory_name dir1 file1.pdf file1.txt dir2 ...
1
vote
1answer
33 views

Performance of `tar -xf` (block size related)

I'm recently working on optimizing the performance of tar -xf, i.e. untar a file. I notice that under default settings, tar -xf calls writes to write 10 KiB output at a time in chunks. However, this ...
1
vote
0answers
32 views

untar error - Cannot change mode to rwxr-sr-x

I am trying to untar a .gz file , which is stored in the /root folder onto a directory in /mnt/flash2/example I use the following command - tar xzf filename.gz --no-same-owner -C /mnt/flash2/example ...
13
votes
8answers
3k views

Memory problems when compressing and transferring a large number of small files (1TB in total)

I have 5 million files which take up about 1TB of storage space. I need to transfer these files to a third party. What's the best way to do this? I have tried reducing the size using .tar.gz, but ...
3
votes
1answer
58 views

Are tars deduplicatable at the block level?

Quite simply, when a tar file is made on disk, would the extents be deduplicatable with extents inside and/or outside of the tar? I am asking in the theoretical sense, so if the extents of data are ...
3
votes
5answers
178 views

View a file in a tar archive without extracting it

I want to view the content of the tarred file without extracting it, Scenario: I have a.tar and inside there is a file called ./x/y.txt. I want to view the content of y.txt without actually ...