New answers tagged

2

Traditionally, Unix systems used one program to perform one task per the Unix philosophy: tar was just a means to package multiple files into a single file, originally for tape backup (hence tar, tape archive). tar does not provide compression; the resulting uncompressed archive is typically compressed with some other program such as gzip, bzip2, or xz. In ...


0

I had the same problem and, in my case, it was due to the fact that the file was an empty (0 bytes) gz file, created with the touch command: $touch file.txt.gz -rw-r--r-- 1 user user 0 2016-05-24 11:48 file.txt gzip could not decompress it, when called with the command: $gzip -dv file.txt.gz gzip: file.txt.gz: unexpected end of file The correct way ...


1

gzip won't find duplicates, even xz with a huge dictionary size won't. What you can do is use mksquashfs - this will indeed save the space of duplicates. Some quick test results with xz and mksquashfs with three random binary files(64MB) of which two are the same: Setup: mkdir test cd test dd if=/dev/urandom of=test1.bin count=64k bs=1k dd ...


0

As an addition to 'mechanical snail's answer: Even xz (or lzma) won't find duplicates if the file size of the uncompressed single file (or, more accurately, the distance between the duplicates) exceeds the dictionary size. xz (or lzma) even on the highest setting -9e only reserves 64MB for this. Luckily you can specify your own dictonary size with the ...


1

tar files store not just the contents of files but also the file names, the file permissions, and more. None of that applies to "the output of a command." From your description, it sounds like you just need gzip. For example: command | gzip >output.gz This captures the output of command, compresses it, and saves it to file output.gz.


1

By tar during extraction you can strip-off the first n leading components of the filename/path. In your case if you have done a tar from files: /bbpre/spool/COPY/ZIP/cp1.txt /bbpre/spool/COPY/ZIP/cp2.txt /bbpre/spool/COPY/ZIP/cp3.txt by extract with strip-components flag you can remove unwanted path filename levels: tar -xvzf yourtar.tar ...



Top 50 recent answers are included