An archive file format (and the program that reads it) commonly used on Unix and Linux.

learn more… | top users | synonyms

8
votes
3answers
6k views

How do I convert tar.bz2 to tar.gz?

I'm new in Linux, is this conversion possible? Do I need to compress and decompress all content?
1
vote
1answer
102 views

Ignoring path while archiving with TAR

I have a file that contain list of files I want to archive with tar. Let's call it mylist.txt It contains: /path1/path2/file1.txt /path1/path2/file3.txt ... /path1/path2/file10.txt What I want to ...
2
votes
2answers
8k views

Untar a given linux tarball on MAC OS X

I have a Linux tarball that can't be unpacked. It gives me an unexpected error. I am told this is due to case insensitive on MAC OS X. How can I untar this file? tar -zxvf file.tar.gz ... x ...
1
vote
1answer
241 views

How to UnTar Wordpress contents to my document root without “wordpress” folder?

The contents of a Wordpress Tarball are all contained within a single directory called "wordpress". I would like to upload the archive to my server (CentOS) and UnTar all the files directly to the ...
35
votes
1answer
62k views

How do I unzip a tar gz archive to a specific destination?

I want to unpack a .tar.gz file to a specific directory. The archive file is in /root/Documents. I want to unzip it into /root/Desktop/folder. The folder structure in zipped file should be preserved ...
0
votes
2answers
1k views

tar: “Cannot stat” when given arguments as shell variables

I have some directories in a location, that location's absolute path is stored in PROJECT_HOME. Now, I am trying to do the following in a script: TARGET_LIST="bin lib scripts deployment" tar -czf ...
4
votes
1answer
5k views

How to tar/untar the output on the fly

What is the idiomatic way to do the following tar to stdout read this tar output from stdout and extract to some other folder. My solution is tar --to-stdout .. | tar -C somefolder -xvf - But ...
3
votes
1answer
1k views

How can I extract only some specific folders from a tar.gz archive?

Let's say I have the archive website.tar.gz, inside is the following folder structure : home -mike -www -coolwebsite file1 file2 file3 etc. When I ...
17
votes
4answers
11k views

TAR vs CPIO, what is the difference?

I am curious and did a bit of reading but still have questions. What makes CPIO different than TAR? I was told in another question that tar is for pulling together many files into 1 archive which ...
1
vote
1answer
842 views

Mounting Fedora ISO DVD and then copy the full DVD structure locally

I need to recreate in a local folder called /distro/fedora/ the full directory tree (including eventually hidden files, symlinks, etc.) contained in the .iso file just downloaded ...
3
votes
2answers
301 views

is it plausible that Ubuntu's wildcard * with tar is somehow failing to restore some files?

In this command line sequence I use a *.sh wildcard to restore some files. I got three hits. Knowing that there must be more, I typed in the whole name. For example: goFindRanges.sh. I was able to ...
0
votes
2answers
622 views

How to tar files with no extensions?

I have some directories with a varying numbers of files and subdirectories. All files that have no extensions have to be tared. Their names may change, thus they can not be hardcoded. Subdirectories ...
5
votes
1answer
2k views

extract a few members from tar archive and pipe through network

edit: I want to extra member01 and member02 and directory blah/ tarball_1.tar.gz contains directory test/ with 20 files. I want to extract only member test/member01 and test/member02 and directory ...
1
vote
4answers
476 views

linux tar command option

I know how to tar a bunch of files, minus several I don't want: tar --exclude=./*.jpg -pcjvf all.tar.gz ./ Here I tar all files, except any jpg extensions. I want to do the opposite. I need to ...
2
votes
2answers
5k views

How can I compress a large file into smaller parts?

I'm looking for a way to compress a large file (~10GB) into several files that wont exceed 150MB each. Any thoughts?
1
vote
2answers
888 views

Excluding Path While Compressing with TAR/GZ

I am compressing list of files like this: tar cvzf mycompress.tar.gz /dir1/dir2/file1.txt /dir1/dir2/file2.txt However when I uncompressed them the directory /dir1/dir2/ is still preserved. How to ...
12
votes
2answers
25k views

Howto pipe: cp | tar | gzip without creating intermediary files?

Can anyone tell me if it's possible to pipe | this without having to create a physical file anywhere between A and B.tar.gz? This is what I'm trying to do: File A Rename A to B Tar B.tar gzip -9 ...
42
votes
6answers
13k views

Linux / OS X tar incompatibility – tarballs created on OS X give errors when untarred in Linux

When I tar up files on my Macbook and untar them in Linux, I repeatedly get the following warnings/errors: tar: Ignoring unknown extended header keyword `SCHILY.ino' tar: Ignoring unknown extended ...
0
votes
1answer
587 views

Merge tar files in Windows Server

In my server(windows server) I have 3 tar files. (file.tar, file.tar-2, file.tar-3). I want to merge those files. (Those are generated by some server tool). So I am looking for a tool to merge ...
3
votes
3answers
4k views

Is it OK to copy (not clone) a git repository using basic Unix commands?

I’m pretty new to using git and was wondering if it’s ok to copy a Git repository with common UNIX commands (like cp or tar/untag), rather than through git clone. I’m in the situation where I have ...
1
vote
2answers
1k views

GREP and TAR all files/directories matching X

I would like to find and gzip/tarball contents of all the folders matching wordpress in my directory, but I am having trouble trying to get the command to work, I thought it was something like find ...
4
votes
1answer
361 views

Tar - split files

i am using the following command to backup and sql file: tar -zcvf "$BACKUP_DST/$FILE_NAME.tgz" "$BACKUP_DST/$FILE_NAME.sql" i want to make sure the compressed file wont be larger then 300mb, if it ...
2
votes
1answer
87 views

Which is better: using flags, or pipes?

As with many things in the *nix world, there is more than one way to generate .tar.gz files. Typically, I use the following: tar zcf /path/to/dir.tar.gz /path/to/dir However, I have seen the ...
0
votes
1answer
245 views

Why is that when I attempt to verify an archive using tar I am displayed the error this does not look like a tar archive?

I am new to the world of linux and when attempting to verify a tar archive I am displayed the following error. When running the command tar cvfW archivename.tar filename directoryname does not yield ...
49
votes
4answers
56k views

How to specify level of compression when using tar -zcvf?

I gzip directories very often at work. What I normally do is tar -zcvf file.tar.gz /path/to/directory Is there a way to specify the compression level here? I want to use the best compression ...
0
votes
1answer
262 views

How to omit the “.” directory when creating a tar from directory?

To create a backup of entire directory I do: tar -cPzf /home/misha/path/to/tar/tar_name.tar.gz -C /home/misha/path/to/directory/to/backup . In the resulting tar_name.tar.gz beside the files ...
2
votes
1answer
1k views

tar - exclude certain files

I wish to tar all files in a directory and its subdirectories that do NOT end in .jpg, .bmp, .gif, or png. So, given the following folders and files: foo/file.txt foo/file.gif foo/bar/file ...
2
votes
2answers
1k views

Convert .tar.gz/.tar.bz2 to .7z in batch?

How do I convert .tar.gz and .tar.bz2 files to .7z files using the command line?
4
votes
1answer
1k views

How to use tar to compress only two files in a directory?

I'm trying to compress only two files in a directory. Let's say I have a directory named 'images'. In the directory, I have a.jpg, b.jpg, c.jpg, and d.jpg. I like to compress only a.jpg and b.jpg ...
1
vote
2answers
1k views

Linux: Compressing all .pdf files recursively (.tar)

At the linux command line, I'd like to compress all .pdf files in a directory, any of it's subdirectories and so on - but only .pdf files. I'm struggling to figure out the syntax, any ideas ...
5
votes
2answers
8k views

What is the fastest compression method for a large number of files?

I need to compress a directory with around 350,000 fairly small files that amount to about 100GB total. I am using OSX and am currently using the standard "Compress" tool that converts this directory ...
0
votes
1answer
157 views

How to create a folder inside a tarball?

I created a tarball with multiple files. The rpm generator requires those files to be inside a folder. I don't want to move the files before generating the tar. Is there a way to create this folder ...
5
votes
5answers
1k views

How to do the equivalent of “grep something * -Rin” on list of tar.gz files?

I've got a bunch of tar.gz files and I want to do a "grep something * -Rin" as I would on them if they weren't tar.gzed. I want to keep them tar.gzed as they are, but grep on them on-the-fly and find ...
2
votes
3answers
227 views

tar-ing / should I use -C / . or just /

tar cvf backup.tar -C / / # or tar cvf backup.tar / produces an archive like etc/ and gives warnings tar: Removing leading `/' from member names tar: Removing leading `/' from hard link ...
3
votes
1answer
173 views

gunzip -c equivalent for tar.gz files?

What is the equivalent of gunzip -c to pipe the content of a bunch of tar.gz files without having to permanently "tar xzf" them and "tar czf" them back? Something like: tar xzf "-c" *.tar.gz | xargs ...
3
votes
3answers
668 views

Control gzip compression rates while archiving files with tar?

I have a script which periodically backs up a directory using the command "tar -czvf [name] [directory]" but my problem is that the script has recently been putting a lot of stress on the server ...
13
votes
3answers
43k views

How to create tar archive split into, or spanning, multiple files?

According to this page, one can let tar create a tar archive "split" into 100 Mb files: tar -c -M --tape-length=102400 --file=disk1.tar largefile.tgz The problem is that this command will ...
5
votes
2answers
3k views

SunOS tar filename is greater than 100

On a Solaris when creating a tar archive using the cf options: tar cf file.tar dir and when many nested directories generates very long path names, I get the error: tar: filename: filename is ...
1
vote
2answers
511 views

Removing folder structure when making a tar from a folder

Ok I don't really want to waste any more time on investigating this but I do want to offer a .tar option for download instead of just zip. $archive = ...
1
vote
5answers
1k views

tar command to extract archive with colon in the name

I try tar -zxvf plugin\:xyz.tgz and received the error: rsh: Could not resolve hostname plugin: Name or service not known tar: plugin\:thold-latest.tgz: Cannot open: Input/output error tar: Error is ...
0
votes
3answers
12k views

How do I compress the contents of a folder using 'tar' over SSH?

How do I compress the contents of a folder using the tar command on an Unix system over SSH?
1
vote
3answers
1k views

Linux tar command with exclude

I want to create tar file of a folder but this folder contains some tar.gz files like abc.tar.gz, pqr.tar.gz which i don't want to include so how to exclude this files while making the ...
1
vote
2answers
210 views

Linux/Ubuntu: How to make archive when there are too many files (6GB = 3 000 files)?

So, how to make a few archive parts or how to make archive for some part of files (0-100 items, than 1000-200 items etc)?
12
votes
3answers
7k views

How to use password protection with the Linux tar command?

How can I use password protection with the tar command in Linux? I'm new to Linux so please explain to me with simple usage.
15
votes
5answers
12k views

.tar files without directory structure

I'm .taring some files with the path example/super_user/Output.*. The resulting .tar looks like this: + example + super_user - Output.zip - Output.xml - Output.txt ...
3
votes
2answers
3k views

tar -C with a wildcard file pattern

Can I use the tar command to change directories and use a wildcard file pattern? Here is what I am trying to do: tar -cf example.tar -C /path/to/file *.xml It works if I don't change directory ...
9
votes
3answers
4k views

Is it possible to mount a .tar file?

The only result of any import when I searched for this was from 2001. In the intervening decade, have any tools/methods for mounting a tar file as a filesystem (perhaps utilizing fuse) been created? ...
16
votes
3answers
6k views

Get mac tar to stop putting ._* filenames in tar archives [duplicate]

Possible Duplicate: Why do I get files like ._foo in my tarball on OS X? I create autoconf scripts on a Mac. When tar runs, it puts all of these ._foobar names in the archive: ...
2
votes
1answer
3k views

is Winrar's “store” mode the same as tar?

The question kind of says it all. When archiving files with Winrar you get the option of different compression modes, one of which is "store". I'm under the impression this does no actual compression ...
9
votes
4answers
3k views

Is there a way to mount a file.tar.bz2 without extracting it onto the filesystem?

Is there a way to mount a file.tar.bz2 without extracting it onto the filesystem? I don't care if the mount is read only. Hopefully your answer will also apply to file.tar.gz. "mount" in this ...