Questions tagged [tar]

GNU tar creates and manipulates archives which are actually collections of many other files; the program provides users with an organized and systematic method for controlling a large amount of data.

GNU tar creates and manipulates archives which are actually collections of many other files; the program provides users with an organized and systematic method for controlling a large amount of data. The name “tar” originally came from the phrase “Tape ARchive”, but archives need not (and these days, typically do not) reside on tapes.

347 questions
17
votes
3 answers

How to list content from a tar file without recursion?

I've a tar (gz, bzip) file and want to see its content, but not recursively. This is: The "first level" in the file. I already know how to see content: tar -ztf file.tar.gz But it's recursive!! Thanks!
santiago.basulto
  • 598
  • 2
  • 8
  • 16
14
votes
2 answers

Get files from server two steps away

We have the following situation: My machine A gateway machine The target machine I have no root rights on both #2 and #3. I can also not really store information (no more then 200 MiB) on machine #2 (since it is ment to be a gateway into the rest…
Cheiron
  • 458
  • 1
  • 4
  • 10
14
votes
4 answers

Force tar to ignore/skip errors while compressing files?

Let's say I do this tar cfzp home.tar.gz /home (takes a while) and a file changes during compression and tar fails, I get "file changed as we read it" and tar stops. I assume home.tar.gz is now incomplete, or was that just the "notice" and not…
PJ Brunet
  • 586
  • 1
  • 5
  • 15
14
votes
2 answers

Can I extract a specific folder using tar to another folder?

I am new to the world of Linux and seem to have run into a stumbling block. I know I can extract a specifc archive using the command tar xvfz archivename.tar.gz sampledir/ however how can I extract sampledir/ to testdir/ rather than the path that…
PeanutsMonkey
  • 1,892
  • 9
  • 27
  • 28
13
votes
3 answers

Getting errors while making backup of whole centos with tar

I am trying this command tar cvpzf /TEMP_BACKUPS/backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/tmp --exclude=/TEMP_BACKUPS --exclude=/mnt --exclude=/sys / > /TEMP_BACKUPS/mylog.txt and i am getting this error. I have tried twice tar:…
user1865341
  • 301
  • 1
  • 3
  • 7
13
votes
1 answer

How to show numerical UIDs/GIDs stored in tar file

I've got some troubles with a tar file that holds a backup. It was provided by our hosting provider and contains some strange file permissions. When viewing with tar tvf example.tar I only get the symbolic owner information of each file (which do…
Scolytus
  • 434
  • 3
  • 7
  • 22
12
votes
3 answers

tar padding with zeros

When performing a tar on a bz2 compressed file I am encountering the following error, tar: dump.sql: File shrank by 19573448400 bytes; padding with zeros Can anyone point what might be causing this issue ? Thanks.
Iliyas Shirol
  • 235
  • 1
  • 3
  • 6
12
votes
2 answers

How can you designate an arbitrary leading path when adding files to a tar?

Is it possible to set an arbitrary path within a tar archive to place files which may not exist on your original filesystem? This differs from the -C switch in that I may want to take a back up of /etc/, but place it in the archive as…
andyortlieb
  • 1,092
  • 1
  • 12
  • 25
12
votes
3 answers

Tar: avoid archiving of files larger than certain size

I want to archive files (with tar) which are below 3 MB in size. But I also want to retain the directories in which those files exist. (so I cannot use find command). I just want to avoid the files which are above 3 MB in size. How can this be done?
nixnotwin
  • 1,543
  • 5
  • 35
  • 55
11
votes
2 answers

How to exclude files from TAR archive using regular expressions?

I have a simple question, yet I can't find or solve the answer. I want to make a tar archive, but I want to exclude some files from it using regular expression. Example of the file to exclude is this: 68x640X480.jpg I have tried this with no…
Frodik
  • 273
  • 1
  • 3
  • 14
10
votes
4 answers

Linux: How to break a large file into smaller files?

I have a giant file (>20 gigs) sitting on my source machine and I need to transfer it to my target machine. For the purposes of this question, let's assume that I do not have network connectivity between the two machines. I need to break this file…
Runcible
  • 3,145
  • 3
  • 23
  • 15
9
votes
4 answers

How to convert a TAR file into an ISO file

I have a Linux TAR file that I would like to convert directly into an ISO. Is there a way to do this, preferably, without having to extract the contents of the file first? This would be similar to the following question; however, this is focused on…
John
  • 2,276
  • 7
  • 44
  • 60
9
votes
4 answers

Which tar file format should I use?

tar can create the archive in different formats. GNU tar, ustar, pax, v7. What would be the best for long time archiving? Is there significant differencies in these formats? I would use the best format for general backups, and I don't want that…
Glendyr
  • 621
  • 2
  • 7
  • 12
9
votes
5 answers

Delete original tar after untar? Not enough space to untar

I have a 130GB tar file I need to untar to /storage. Problem is, I don't have enough disk space for both to exist at the same time. How can I untar the tar file, and ensure there is enough disk space, and delete the file immediately after…
Andrew Fashion
  • 1,655
  • 7
  • 22
  • 26
8
votes
3 answers

Shell command to filter out non-existing files in a pipe

I'm looking for a nice way to generate a backup tar.gz of what is going to be overridden by the extraction of another tar.gz. tar -ztf patch.tar.gz | grep -v "/$" | tar -T- -zcvf backup.tar.gz This works perfectly! However, sometimes, the new patch…
Fox
  • 992
  • 2
  • 14
  • 23
1
2
3
23 24