Questions tagged [tar]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
39 views

Only one file is extracted from huge tar archive

I have a 124GB tar archive. When I run: tar xvf archive.tar I get only a 1.1GB file (which is one of the expected file). What happened to the rest of the files ? Is there a way to recover them? I ...
user avatar
  • 101
0 votes
0 answers
11 views

how to stream a large directory to a HTTP server via CURL put?

I have a large directory that I want to upload to a remote server using only tar and curl. I don't need any compression as the directory already contains compressed data. here is the command I am ...
user avatar
18 votes
2 answers
3k views

What does `tar: Cannot connect to …: resolve failed` mean?

I'm writing a practice bash script that saves a folder as a tar archive with a name date-foldername.bak The script fails when unformatted date is inserted as part of the filename, so 2022-05-09-work ...
user avatar
0 votes
0 answers
23 views

Create tar with directory and only specific files

I have this directory structure /Foo A B C D I'd like to create a foo.tar with this structure /Foo A D where files A-B-C-D aren't related so I need to manually specify which one add and ...
user avatar
  • 101
0 votes
1 answer
23 views

How to compress the main folder which includes certain sub folder using tar

Assume we have a folder structure as below main_folder - sub_folder1 - sub_folder2 - sub_folder3 - valid_folder1 - valid_folder2 - junk_folder1 - junk_folder2 ...
user avatar
2 votes
0 answers
14 views

Extract files from tar directly into new tar

I have a large tar.gz of a whole system (basically tar czpf --one-file-system /mnt/usb/backup.tar.gz -C / .). I want to end up with a new tar.gz file that is just the contents of a subfolder (./home) ...
user avatar
0 votes
0 answers
35 views

How to compare huge sparse files efficiently?

There are two sparse files. They are proved identical by diff. But it took 20 minutes (too long time) to compare. I am thinking of taring them into tiny files to speed up the comparison. But they tar ...
user avatar
  • 481
1 vote
1 answer
173 views

Errors with tar/split backups

I am trying to create backups on an external exFAT disk, but I keep getting errors. I have to use FAT (exFAT or FAT32), so my options are very limited. I will need this to backup both macOS and ...
user avatar
  • 111
1 vote
1 answer
21 views

Create .tar back-up across two drives on Windows 10

My main drive (D:) has 500GB capacity. I also have two backup drives (both 250GB capacity). I want to back up the contents of the 500GB drive and spread it across the two 250GB drives. 7-zip allows to ...
user avatar
0 votes
0 answers
27 views

Is there a way to concatenate and compress tar archives without materializing any uncompressed archive?

Say i have two sets of files, and i wish to make a single compressed tarball containing both sets, where each set has a different set of tar options (in my case, two settings of --dereference, but ...
user avatar
  • 1,613
0 votes
0 answers
39 views

Is there a way to extract partial content from a tar.xz file?

I have a tar.xz file in a server. I would like to see what is inside and extract some of the content. The problem is that this file is 1.24TB large! My local PC can not hold it. Is there a way to ...
user avatar
2 votes
1 answer
30 views

tar delete file with pipe without extract: what is the correct syntax?

I am using GNU tar to process a tar(layer of a docker image) to modify some jars in that. I am doing: save image to disk as tar extract it, so I have each layer in a dir enter each layer, I have a ...
user avatar
0 votes
0 answers
16 views

Using debian dpkg

i am trying to understand this command root@debian:curl -sL -o- "http://httpredir.debian.org/debian/pool/main/y/yade/yade_2016.06a-7_AMD64.deb" |dpkg-deb --fsys-tarfile /dev/stdin |tar -xO ./...
user avatar
0 votes
1 answer
55 views

I cannot seem to get GALFIT installed on my computer

I downloaded the code provided on the GALFIT website for debian/ubuntu 32. I then decompressed it, so it is just a folder with "galfit" being the only thing inside of it. When I look up &...
user avatar
1 vote
0 answers
24 views

Compress a folder with internal complex folders tree and UTF-8 mixed languages files and formats for archive

I have a cloud folder on my hard-drive which I want to archive, in-order to do so I would like to compress it using best of choice compressor for that task : Complex sub-tree of internal folders with ...
user avatar
0 votes
1 answer
81 views

tar command not working

I'm trying to figure out why is the following tar command not working - I've tried the following 2 versions & both don't work - Version 1 tar -c --use-compress-program=pigz -f /home/jhonst/...
user avatar
2 votes
0 answers
332 views

No space left on device in Linux although enough disk space and inode available

I ran into this problem when copying a lot of files using tar -cf - * | (cd ../bar; tar -xf - ); I did search on the issue, and found the below suggestions, none of which worked for me. This problem ...
user avatar
1 vote
1 answer
45 views

Trying to replicate tar output format on windows 10

I've been managing data at my work for over 20 years and we've always used tapes written with the unix command tar. The biproduct of this is a tar table of contents that I store for reference when ...
user avatar
  • 13
0 votes
2 answers
116 views

Can one extract the files in a .tar.gz and upload them individually onto cPanel?

I am in the process of migrating my website from Bluehost to a different hosting company. I downloaded the entire backup of the cPanel (61 GIG) successfully, but uploading files is incredibly much ...
user avatar
0 votes
0 answers
54 views

Decompress a tar.xz file using all cores

I have 37 GiB File which was created by tar + xz. I have a server with 6 cores, so for maximum compression speed I want to use all my 6 cores using this command XZ_OPT='-T0 -9 –memory=75%' tar -cJf ...
user avatar
0 votes
0 answers
39 views

How does GNU tar handle reflinks?

Does (GNU) tar handle reflink copies of files similar to hardlinks? I.e., is just one copy of the file stored and other copies refered to? Or are reflinks 'resolved' from the file system and each ...
user avatar
  • 133
0 votes
1 answer
27 views

Explaining performance irregularities when unpacking .tar.gz archives

This question is about the performance of unpacking, not "how to" unpack. I notices this just a few days ago, when I started extracting several .tar.gz (will refer to them as archives now) ...
user avatar
  • 103
0 votes
0 answers
14 views

How can I archive multiple folders into a single tar file where all the folders are contained inside a single folder? [duplicate]

I have multiple folders that I want to be backed up regularly. My aim is to have a tar archive which has a single "Backup" folder inside it. Inside this "Backup" Folder would be ...
user avatar
0 votes
1 answer
39 views

How to fix tar/gzip files after change extension?

I am new in linux. Today I got issue.Then I run tar to zip multiple files(hundreds files) I got a.php.gz,b.php.gz,etc. After that I rename files via command line find /usr/local/var/www/html -depth -...
user avatar
  • 101
0 votes
0 answers
106 views

Error when tar a compressed file

I try to install krona tools, so I downloaded its archive first as follows: curl -LOk https://github.com/marbl/Krona/releases/download/v2.7/KronaTools-2.8.tar then #untar tar -xvf KronaTools-2.8.tar ...
user avatar
  • 1
4 votes
2 answers
315 views

How do you untar multiple files into multiple subdirectory based on filename

I have a single tar file containing about 19 million files (no folders) 0000107b869682826003b04a40e6394.txt 00029237482s8923789423ud8923892.txt 2c002y8378723887292377a79237649.txt ...
user avatar
1 vote
0 answers
13 views

Bypass `-C` flag when unzipping tar archive

I have a .tar.gz archive with the following structure: opt/client/py/utils/mappings/templates/config.json opt/ opt/mag/ opt/mag/sw/ opt/mag/sw/apps/ opt/mag/sw/apps/service/ opt/mag/etc/ opt/mag/etc/...
user avatar
  • 111
0 votes
1 answer
222 views

How to extract all files from a tar.gz with same names, but different content without overwriting repeated files

My tar.gz has multiple files with the same name but each file having different content ex: a.csv, b.csv, c.csv, a.csv, d.csv, a.csv and c.csv. If I do tar -xvf filename.tar.gz | wc -l I'll get the ...
user avatar
1 vote
1 answer
214 views

tar extracting on root directory is destroying entire system

I'm not sure whats going on... I wasn't aware tar did this. But when I extract a tar on top of the root fs (/) with all the permission stuff turned off... for instance: root@system:~# tar --no-same-...
user avatar
0 votes
0 answers
58 views

What's the *proper* way to extract complex source code with tar?

Is there a standard way to use tar to decompress complex source code (such as in C or C++), in particular, which commonly includes symbolic links? The idea is to decompress it in a way that won't ...
user avatar
0 votes
1 answer
130 views

transfer files from remote-server to local-host via jump-host when port-forwarding is administratively inhibited

a valid however sometimes hindering policy at work is that remote server ports are not available in user space. I only found the following solutions which (probably, as I didn't try them all) won't ...
user avatar
0 votes
1 answer
140 views

How do I maintain integrity on zip and unzip?

I'm taking a dd of a drive and trying to share it with a friend. It's rather big after dd (~8gb). When I tar -czvf my-image.img I can get it down to ~1.5gb. However, if I try to test unzip it, I see ...
user avatar
  • 155
0 votes
0 answers
343 views

Cannot extract file using “tar.exe -xvf” on command line but GUI can open the archive file?

I have a tar file that cannot be opened using the command below. tar.exe -xvf filename.tar The error given is: tar.exe: Error opening archive: Unrecognized archive format However, when I use the UI(...
user avatar
1 vote
0 answers
27 views

zip counterpart to tar -d

Decades ago, I relied heavily on tar czf ... to create snapshots of sprawling work. However, the rest of the world runs on Windows and zip. My experience in those past decades is that using unzip on ...
user avatar
0 votes
1 answer
23 views

bash workflow for operating with big number of tar.gz archives

I am working with the directory consisted of 4 sub-dirrectories ls -t pnmrnp40_to_69 pnmrnp9028_to_9100 pnmrnp00_to_39 pnmrnp70_to_9028 inside of each prmnp* subdir there are many filles belonged ...
user avatar
  • 147
1 vote
1 answer
31 views

Modify $PATH while unpacking archive in Linux

Suppose I have tar.bz2 archive, with some directory that has binary file and some assistive files for it. When user unpack it, he must start binary from within the result directory such a way: ./...
user avatar
  • 153
0 votes
1 answer
134 views

Linux says tar file doesn't exist

I'm REALLY new to Linux, so just bear with me... I downloaded a .tar.bz2 file, and I am trying to unpack it. However, each time I attempt to unpack the tarball using tar zxvf Linux says "Cannot ...
user avatar
0 votes
1 answer
142 views

Tar failing to extract specific files

I am extracting a number of .tar.gz files using a batch script in Windows. The tar files are all different data sets and should generally have the same directory and file structure, just with ...
user avatar
  • 287
1 vote
1 answer
853 views

What is the meaning of -a option in tar.exe command?

Purpose: zip a folder in window and extract it in linux. I prefer to https://superuser.com/a/898508/1451256 and I realize there is no description for -a option in tar.exe --help: https://ss64.com/nt/...
user avatar
0 votes
1 answer
124 views

tar extract with user ignores umask on CentOS 8

Usually as far as I know when extracting files with tar the users umask should be used for new permissions. My umask is 0007. So when I create new files they have the permission: -rw-rw---- I have a ...
user avatar
0 votes
0 answers
11 views

Tar --remove-files EXCEPT FOR filename

Is there a way to create a tar archive where you specify --remove-files but can also specify files that you DON'T want removed? For example, let's say I have these files: me@me:~$ ls file1 file2 file3 ...
user avatar
  • 13
1 vote
2 answers
298 views

Tar extract a stream of tar files

I've got a binary (lets call it displayFiles) which will get several tar files at once and print the tars to stdout. I then pipe the stdout to tar. This works fine when the binary only downloads a ...
user avatar
  • 13
0 votes
1 answer
296 views

Decrypting tar archives with gpg -d, the -d flag does not work

My OS is Ubuntu 20.04.2 lts. I am creating a tar archive from the dir noup1, that contains files and subfolders, with tar cf no1.tar noup1 Encrypt it with gpg -c no1.tar. So now I have a no1.tar.gpg ...
user avatar
242 votes
3 answers
58k views

Why are tar.xz files 15x smaller when using Python's tar library compared to macOS tar?

Context I'm compressing ~1.3 GB folders each filled with 1440 JSON files and find that there's a 15-fold difference between using the tar command and Python's built-in tarfile library on macOS or ...
user avatar
0 votes
2 answers
2k views

Uncompress .tar.gz format getting error "tar: Unrecognized archive format"

I've downloaded a ".tr.gz" file with a size of 10 GB from here (after downloading completed, I renamed it and deleted .partb to become dataset cleaned.tar.gz) while I'm trying to uncompress ...
user avatar
  • 101
0 votes
1 answer
188 views

Which Folder to File method compresses the most? zip vs tar.gz vs tar.bz2 vs tar

I'm trying to download a large Gitlab repo in a script, and Gitlab offers each of the zip, tar.gz, tar.bz2 and tar options, and I want to pick the one that will have the smallest file size. Will one ...
user avatar
0 votes
1 answer
234 views

Creating GPG encrypted tar.gz Backup fails

I hope this kind of question is ok here ;) I am on Debian 10 Buster, trying to create an (GPG) encrypted, compressed tar file without intermediary files. I found this article[1] on the web which ...
user avatar
  • 3
1 vote
0 answers
306 views

extract zip file and delete by batch

I want to unzip all the .zip files in a download directory like "D:\Download", and then the zip files should be deleted after the contents have been extracted to a folder with the zip file ...
user avatar
1 vote
0 answers
23 views

How do I choose a directory name during zip on Linux?

Tar works fine: tar -zcvf cli-layer.tar.gz cli_layer --transform s/cli_layer/python/ ls -al drwxr-xr-x 3 alexb alexb 4096 Dec 16 16:38 . drwxr-xr-x 4 alexb alexb 4096 Dec 16 16:40 .. drwxr-xr-x 6 ...
user avatar
  • 111
1 vote
1 answer
57 views

Compare folder with tarball

I have a directory structure like this Code ├── cse701.tgz └── cse701 ├── cse701.md ├── CSE701.md ├── CSE701_pandoc.md ├── cse701.pdf ├── cse.pdf ├── default.yaml ├── ...
user avatar
  • 113

1
2 3 4 5
15