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

learn more… | top users | synonyms

12
votes
5answers
1k views

How to de-unzip, de-tar -xvf — de-unarchive in a messy folder?

Usually, I unarchive things by $ mkdir newFolder; $ mv *.zip newFolder; $ cd newFolder; $unzip *.zip but sometimes I get lazy and just do in an arbitrary folder $ unzip *.zip so time-to-time messing ...
21
votes
3answers
43k 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 ...
3
votes
2answers
2k views

Search for a file inside a tar.gz file without extracting it and copy the result to another folder

I need to search for a file inside a tar.gz file without extracting it. After that, I need to copy the file that was searched (if ever there is) to another folder. So far I have this, but the copy ...
4
votes
2answers
810 views

Find recursively all archive files of diverse archive formats and search them for file name patterns

At best I would like to have a call like this: $searchtool /path/to/search/ -contained-file-name "*vacation*jpg" ... so that this tool does a recursive scan of the given path takes all files with ...
9
votes
2answers
1k views

What does “-” mean as an argument to a command?

I found this link on how to open tgz in one step. gzip -dc target.tar.gz | tar xf - What does the '-' mean?
22
votes
6answers
37k 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 ...
14
votes
3answers
2k views

Why use superflous dash (-) to pass option flags to tar?

To create a tar file for a directory, the tar command with compress, verbose and file options can be typed thus: $ tar -cvf my.tar my_directory/ But it also works to do it this way: $ tar cvf ...
9
votes
3answers
1k views

Universal extractors

With an increasing number of archive/compression file formats, is there a single free/open-source command line tool to rule them all? Perhaps something with a consistent / unified set of flags? (note ...
5
votes
2answers
691 views

What do these commands (`tar`) actually do? Is there a better way?

I am going over some documentation pertaining to creating a distro repo. However, I cannot understand exactly what these commands perform: # cd /mnt/ # ls centos-1 centos-2 centos-3 # for i in 1 2 ...
11
votes
6answers
10k views

tar + rsync + untar. Any speed benefit over just rsync?

I often find myself sending folders with 10K - 100K of files to a remote machine (within the same network on-campus). I was just wondering if there are reasons to believe that, tar + rsync + ...
18
votes
2answers
893 views

What does .??* mean in a shell command?

The following command will tar all "dot" files and folders: tar -zcvf dotfiles.tar.gz .??* I am familiar with regular expressions, but I don't understand how to interpret .??*. I executed ls .??* ...
16
votes
2answers
12k views

tar cvf or tar -cvf ?

I have learned to use tar without '-' for options, like tar cvfz dir.tar.gz Directory/ but I recently came accross the slightly different tar -czvf syntax (I think the 'f' must be the last option in ...
7
votes
2answers
4k views

Can I automate tar's multi-volume-feature?

Ok, so I've just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a quite nice multi-volume feature, although when I try it ...
6
votes
4answers
5k views

Preventing tar from using too much CPU and disk (old laptop crashes if 100%)

I want to backup 1 terabyte of data to an external disk. I am using this command: tar cf /media/MYDISK/backup.tar mydata PROBLEM: My poor laptop freezes and crashes whenever I use 100% CPU or 100% ...
11
votes
2answers
859 views

Tar up all PDFs in a directory, retaining directory structure

I'm trying to create a compressed tarball that contains all PDF files that exist in one of my directories. The directory structure needs to be retained. Empty directories are not needed, but I really ...
7
votes
3answers
2k views

Untar only a certain number of files from a large tarball

I have a large tarball that is busy being FTP'd over from a remote system to our local system. I want to know if it is possible to start untarring lets say 50 files at a time so that those files can ...
13
votes
3answers
2k views

What are the differences between bsdtar and GNU tar?

I've always used GNU tar. However, all GNU/Linux distributions that I've seen ship bsdtar in their repositories. I've even seen it installed by default in some, IIRC. I know for sure that Arch ...
8
votes
2answers
185 views

How to convince tar (etc.) to archive block device contents?

I have six Linux logical volumes that together back a virtual machine. The VM is currently shutdown, so its easy to take consistent images of them. I'd like to pack all six images together in an ...
7
votes
3answers
2k views

creating archive using tar including all 'dotfiles' but excluding all subdirectories and /wo directory structure

I want to backup all the 'dotfiles' (f.e. .zshrc) under my home directory with tar, but excluding the directory structure and all subdirectories. I've tried it several times with different commands, ...
6
votes
2answers
4k views

tar files from another directory without copying them

This should be very simple for experts in here. I have a Linux account with user disk quota of only 6GB. There is some data-folder in /opt with about 3GB of data with when compressed comes up 1GB. ...
4
votes
5answers
8k 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 ...
2
votes
4answers
88 views

What year did the Unix “tar” program get released?

Here's an simple question: what year did the Unix "tar" (TApe ARchive) come out? I wasn't able to find the answer with Internet searches.
2
votes
2answers
823 views

How do I dereference links when extracting from a tar file?

If I have a tar file, bob.tar, which contains real_file and link_to_real_file, in which the latter is a symlink, is there a way to extract the contents of bob.tar so that link_to_real_file will not be ...
1
vote
1answer
277 views

Symlinks and permissions in backup archives

I installed linux on another computer and I want to move my /home directory to that computer. I want to backup that directory with any file permission, symlinks etc. how should I do it? Are there any ...
1
vote
4answers
554 views

tar a specific number of files listed in a text file

I have a text file which contains a list of files. I use. tar --null --no-recursion -uf abc.tar --directory= /tmp/temp --files-from abc.txt This command simply creates a tar with all the files ...
1
vote
0answers
190 views

How to do incremental backup of .img files containing windows partition?

On an OVS I have a few windows machines. I want to create a full backup their .img disk files, thats done, .img.gz. Than I want to incrementally backup their C:/ partition, but thats not working. ...
1
vote
2answers
285 views

Why is my tar file bigger than its contents?

I have a tar file that I have recreated from two files - xaa, xab (the results of using the split command). The tar file is the size I expect it to be but when I extract it the folder I get is a ...