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

learn more… | top users | synonyms

1
vote
2answers
4k views

Use tar and gz to create archive in Ubuntu Terminal

I want to archive 3 folders, given their names in Ubuntu command prompt. When I use tar -c abc tt zz -> it will do nothing.
1
vote
1answer
482 views

Can I stop a netcat tar pipe and continue later without overriding existing files?

I'm trying to copy a lot of files from my NAS to my server, about 2TB. I found that using a netcat tar pipe to copy the directories goes pretty fast, about 40mb/s. It seems to work faster than rsync ...
1
vote
2answers
178 views

tar -x -v -f on tape drive in Ubuntu (latest)

I am given the following command: tar -x -v -f /dev/rct0 -b 20 * Could someone please explain its meaning, because in this form it looks completely useless to me. As far as I know -x stands for ...
0
votes
1answer
159 views

How to merge file when unarchive the tarball?

I downloaded a tarball(abc.tar.gz) which has a root folder(abc) and multiple subfolders(a, b, c, etc). And I have a folder called Target in machine(macbook pro), with multiple subfolders(a, b, c, etc) ...
3
votes
4answers
10k views

How do I password protect a .tgz file with tar in Unix?

I'm using the Unix tar command as follows to tar up a directory and its files: tar cvzf fileToTar.tgz directoryToTar Is there a way to password protect the .tgz file? I've created ...
1
vote
1answer
62 views

make: my own simple repository

I have got an account on a server at my university. I want to share a program code with another student. I thought I should put it on my github account. Unfortunately, I cannot because the code is ...
1
vote
2answers
670 views

tar compare or diff command line

What is wrong with this? tar --diff --gunzip --file=/media/disk/filename.tgz This is GNU tar 1.23 on Ubuntu. The complaint is gzip:stdin:input/output error. The following just hangs and there is ...
1
vote
3answers
1k views

What does `tar -C` mean?

In the section "Installing Portage", the Gentoo installation docs say: # tar xvjf /mnt/gentoo/portage-latest.tar.bz2 -C /mnt/gentoo/usr What does this command do?
1
vote
1answer
6k views

tar shows “is not a bzip2 file” error when uncompressing a .tar.bz file

I've a data_or.tar.bz file I tried to extract it with $ tar xjvf data_or.tar.bz Output is bzip2: (stdin) is not a bzip2 file. tar: Child returned status 2 tar: Error is not recoverable: exiting ...
7
votes
3answers
4k 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
84 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
4k 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
194 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 ...
20
votes
1answer
33k 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 ...
2
votes
1answer
2k 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 ...
2
votes
1answer
997 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 ...
12
votes
4answers
7k 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
755 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
282 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
512 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 ...
3
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
214 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 ...
0
votes
2answers
3k 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
507 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 ...
6
votes
2answers
13k 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 ...
20
votes
5answers
8k 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
377 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 ...
2
votes
2answers
2k views

Git: Is it OK to copy (not clone) a git repository

I'm pretty new to Git and was wondering if it's ok to copy a git repository with common UNIX commands (like cp or tar/untar), rather than through git clone. I'm in the situation where I have a ...
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
300 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
84 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
212 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 ...
38
votes
4answers
33k 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
250 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
650 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 ...
1
vote
1answer
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?
3
votes
1answer
828 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
919 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 ...
4
votes
2answers
5k 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
117 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
210 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
146 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 ...
2
votes
3answers
514 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 ...
10
votes
3answers
28k 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 ...
3
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
446 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
852 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
10k 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?