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

learn more… | top users | synonyms

3
votes
5answers
4k views

tar - exclude does not work

I've supposed to archive a directory with tar and exclude some files. I have a directory $HOME/java which includes some .java and .class files. What I want to do is exclude all .class files using the ...
2
votes
4answers
4k views

Rsync to stdout?

I have access to backup server via rsync protocol (only rsync, nothing else). Now, I want to fetch file from there (which is .tar.gz) and pass it directly to tar command, without saving the archive in ...
8
votes
4answers
3k views

In place extract tar archive

I have a little dilemma here... I needed to move about 70 GB worth of files from one of my servers to the other, so I decided that tarring them up and sending the archive would be the fastest way. ...
4
votes
2answers
8k views

How to extract a single folder and its subfolders from a “tarball” (.tar.gz)

I need to extract a single folder and its subfolders from a tarball (.tar.gz) on a CentOS server. I haven't the slightest clue how to do it using an SSH terminal. I tried: gunzip -c ...
0
votes
2answers
210 views

Untar with date filter

Is there any way to untar and only extract those files that are above a certain date including directory structure?? I restored a backup on a play server but it was a few days old. However I have a ...
1
vote
2answers
16k views

tar Cannot open: No such file or directory

Fresh install of CentOS 5.4 Downloaded the following: http://prdownloads.sourceforge.net/webadmin/webmin-1.510.tar.gz MD5 sum is correct (cdcc09d71d85d81914a90413eaf21d3f). The file is located ...
4
votes
3answers
2k views

how do I use tar -C on Snow Leopard when creating an archive?

The man page states -C directory In c and r mode, this changes the directory before adding the following files. However, tar does not change to the directory I specify, but instead reports ...
5
votes
3answers
5k views

Using find and tar with files with special characters in the name

I want to archive all .ctl files in a folder, recursively. tar -cf ctlfiles.tar `find /home/db -name "*.ctl" -print` The error message : tar: Removing leading `/' from member names tar: ...
13
votes
2answers
9k views

unpack 'tar' but change directory name to extract to

tar -tf filename.tar folder1/file folder1/name [...] I'd like to extract file and name to, folder2. Can this be done as a one-liner?
1
vote
2answers
81 views

Data Archiving vs not

For the sake of data integrity, is it wiser to archive your files or just leave them unarchived. No compression is being used. My thinking is that if you leave your files unarchived, if there is ...
7
votes
4answers
645 views

Tar and gzip together, but the other way round?

Gzipping a tar file as whole is drop dead easy and even implemented as option inside tar. So far, so good. However, from an archiver's point of view, it would be better to tar the gzipped single ...
1
vote
1answer
433 views

Can I get the version number of tar used to create a specific tar file?

I need to know the version number of tar used to create a specific tar file. How can I do that?
3
votes
1answer
9k views

Why is “tar” trying to create an empty archive?

I'm trying to use tar to tar files before transfer, so I can keep the entire file path rather than losing it along the way. However, when I try to tar an empty folder, it tells me that it is cowardly ...
0
votes
1answer
302 views

Can you open a tarball on Mac OS X in the GUI?

If I send a tar.gz file to a Mac OS X user, will they be able to open it in the GUI, just like a zip file?
1
vote
4answers
274 views

Zip only public directory

I've a lot of websites (100+ directories) I want to create a unique zip with only public subdirectory. My structure now is like: - Site 1 --- app --- tmp --- log --- public - Site 2 --- app --- ...
0
votes
1answer
647 views

Binaries for gnu tar and gnu gzip

I would like to know where i can download the binaries for gnu tar and gnu gzip for various platforms ( aix64, hp64, hpia64, intel, linia32, linia64, linx64, solus64, solx64, winx64) Thanks,
0
votes
2answers
5k views

How to delete a tar file after I gzip it?

I am creating a tar file and then I am gzipping the tar file. So I am getting a .tgz file and now I want to delete the previous tar file. ${gzipExe} -f --rsyncable $tarname.TAR --stdout >> ...
1
vote
2answers
887 views

zip file on ubuntu without getting a cpgz file on extraction

I get a cpgz file when trying to extract the contents of a file created on an ubuntu system. Tried with 7zip, rar, zip, tar, nothing works... I really need to get this to work, so if somebody had a ...
1
vote
2answers
2k views

MinGW tar compression problem

I am unable to get the Mingw tar to work with compress files. It does not filter through the proper compression utility. However, tar will work if I manually uncompress the file first. I have tried in ...
1
vote
1answer
64 views

What should I do if tar have no “-I” option?

I found "-I" option of tar is only availbe for Solaris, and no countpart in Linux machine, what should I do to realize same operation?
6
votes
3answers
9k views

How can I remove the leading path from a tar and retar it in memory?

I was thinking I could do something like this: wget -O- http://example.com/funky.tar.gz | \ tar --strip-components 1 -Ox | tar -cf fixed.tar.gz to remove the leading path from all items in the ...
3
votes
3answers
541 views

Weird bug in 'tar' not including files named .__init__.py

Does anyone know why tar is not including files named .__init__.py (note the dot)? $ mkdir /tmp/work && cd /tmp/work $ mkdir foo $ touch foo/.__init__.py $ touch foo/.namespace__init__.py $ ...
12
votes
1answer
245 views

Three formats? Why?

I needed to download the Ruby Source recently from here and it says, "available in three formats" which are .tar.bz2, .tar.gz and .zip. Is there any reason that we need all three formats? At least on ...
2
votes
1answer
1k views

.tgz not extracting properly

I've just received some files file(s).tgz... I've tried tar -xvzf file.tgz... However I'm getting error "Attempt to write to an empty file"... Am I missing something... The folder directory system has ...
2
votes
1answer
1k views

how to split tar in two files

I'm trying to upload my tar'ed site to server but I have upload limit. My ftp program extracts tar after uploading it. How do I split this one tar into two so I could upload one tar and let it extract ...
6
votes
2answers
1k views

tar a directory

I'm trying to tar my website files that are on my test server to be able to upload them to 'real' server. tar -cf mysite.tar /var/www It creates archive fine... but when I open that archive it has ...
1
vote
2answers
582 views

Creating a compressed archive with “tar” over the network

I want to copy a local disk image to another computer in the local network. It is a large directory (around 15 GB) and to speed it up I use this little trick: cd /Volumes/myserver tar -cvzf ...
5
votes
2answers
3k views

Specify root dir inside tarball

Is there a way to execute tar cjvf foo.tar.bz2 project-root Such that when the tarball is extracted, it doesn't extract to project-root, but instead extracts to something else? i.e. tar xjvf ...
7
votes
5answers
36k views

How to tar directory and then remove originals including the directory?

I'm trying to tar a collection of files in a directory called 'my_directory' and remove the originals by using the command: tar -cvf files.tar my_directory --remove-files However it is only ...
3
votes
5answers
347 views

Migrate 80 GB worth of files from one NTFS drive to another with metadata and error correction

I want to copy all my files from my NTFS Windows XP drive to a folder on my new NTFS Windows 7 drive, including Program Files, etc. just in case I need them. I have an external drive I can use as an ...
2
votes
6answers
2k views

Mounting a .7zip file containing .tar

I have downloaded wikipedia in a compressed form. It is a .7z file, which contains a .tar file. In compressed form it is only 14 GB. If I uncompress it, it has 208 GB in it. And I don't have that much ...
2
votes
1answer
3k views

tar: extract myfile.tar.gz archive to a directory named myfile

Can it be done with tar? Do I have to write a bash script?
4
votes
2answers
2k views

Tar: How to ignore the archive itself

I was planning to do a quick backup of my website. So I tried to run the following command in my webroot: tar cvfz backup.tar.gz . That seemed to be working nicely for a while. Until I discovered ...
4
votes
3answers
2k views

How to tar.gz everything but .jpg/gif/png/wmv/flv/tar.gz/zip?

how do I tar.gz everything apart from jpg/gif/png/wmv/flv/zips, recursively, via the Unix shell?
13
votes
5answers
9k views

SVN directly to tar

Is there a way to directly tar the latest version of an SVN folder without the SVN hidden files? I would like to create a tar archive without the SVN files. I know you can get the latest with the SVN ...
3
votes
3answers
296 views

tar: million of files

I have to pack circa 7,000,000 small files. I'm looking for an efficient way to do this. Is tar the best way? What about benchmark tests or any other suggestion?
20
votes
6answers
20k views

tar – extract discarding directory structure

unzip has a nifty option -j, whereby the directory structure of the archive is discarded, and all files are extracted into the same directory. Is there a way of making tar work in the same way? ...
12
votes
1answer
9k views

How can I force only relative paths in “find” output?

I am attempting to create a script that can compress files with a certain extension in a number of directories into a single tar-ball. Currently what I have in the script file is: find "$rootDir" ...
1
vote
3answers
5k views

Tar an entire folder EXCEPT a few files and folders?

I have a folder structure like so: file1 file2 file3 file4 folder1 folder2 Without writing each file, how can I tar zip all the files and folders, except file1 and folder1?
2
votes
2answers
1k views

How do I tar/gzip and then delete directories somewhat safely?

How should I tar/gzip and delete files somewhat safely? Background: We're running a little low on disk space on a Ubuntu computer (Hardy Heron), and I want to tar/gzip, verify that it worked, and ...
3
votes
1answer
680 views

Importing to mysql from a .gz via shell - how to do it without extracting to a file? [duplicate]

Possible Duplicate: Pipe gunzip and mysql to gunzip a dump and import it i have a .gz file of an sql dump. at the moment i extract it to its own file (ie dump.sql.gz extracted to dump.sql) ...
27
votes
5answers
10k views

Why do I get files like ._foo in my tarball on OS X?

When I tar certain files in OS X: tar cvf foo.tar foo It produces an extra file ._foo in the tarball: ./._foo foo which only shows up if I extract it on a non-Mac operating system. But ._foo ...
19
votes
7answers
17k views

How can I create a zip / tgz in Linux such that Windows has proper filenames?

Currently, tar -zcf arch.tgz files/* encodes filenames in UTF, so Windows users see all characters spoiled in filenames which are not english, and can do nothing with it. zip -qq -r arch.zip files/* ...
1
vote
1answer
1k views

Is it possible to continue incomplete tar jobs?

Is it safe to continue an incomplete tar job? Background: I was doing tar -czvf backup_20091013.tar.gz directory1 directory2 ... > tar_log_20091013.txt and to be safe, I put the shell window on ...
4
votes
2answers
1k views

Linux - Is there a way to convert .bz2 files to .tar.bz2 files using pipes?

Is there a way to convert a .bz2 file to a .tar.bz2 file without decompressing the entire thing to disk and then re-compressing? The decompressed size is larger than my drive. Since bz2 operates on ...
7
votes
2answers
2k views

Show tar files sizes

I've got a bad backup script including an unwanted file. The .tar.gz backup file is 5gig big and I'd like to get a list of every file in the archive and their size. Is that possible ? How would you ...
3
votes
3answers
394 views

Opening up a .tar file on Windows

What Windows tool or program can I use to open a .tar file? I also have .tar.gz files that I would like to open.
11
votes
5answers
3k views

Map “untar” to tar xvfz?

How can I map 'untar' as a command to 'tar -xvfz' ? Sorry, but I almost always forget the arguments necessary to 'tar' for this operation.
2
votes
3answers
2k views

programmatically extract tar.gz in a single step (on windows with 7zip)

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: stackoverflow question for tar-gz. My question is almost the same, but ...
54
votes
15answers
46k views

Untar, ungz, gz, tar - how do you remember all the useful options?

I am pretty sure I am not the only one with the following problem: every time I need to uncompress a file in *nix I can't remember all the switches, and end up googling it, which is surprizing ...