How to use tar and filter the archive through LZ4? Or any available tools? It looks cumbersome to use tar cvf folderABC.tar folderABC && lz4c -c0 folderABC.tar
.
PS: *nix environment
Similarly, lz4 -m -d can decompress multiple *. lz4 files. It's possible to opt-in to erase source files on successful compression or decompression, using --rm command. Consequently, lz4 -m --rm behaves the same as gzip .
Description. lz4 is an extremely fast lossless compression algorithm, based on byte-aligned LZ77 family of compression scheme. lz4 offers compression speeds of 400 MB/s per core, linearly scalable with multi-core CPUs.
The most common uses of the tar command are to create and extract a tar archive. To extract an archive, use the tar -xf command followed by the archive name, and to create a new one use tar -czf followed by the archive name and the files and directories you want to add to the archive.
On GNU tar
, you can use -I lz4
Both FreeBSD and GNU tar seems to support --use-compress-program=lz4
as well.
tar -I lz4 -cf archive.tar.lz4 stuff to add to archive
tar -I lz4 -xf archive.tar.lz4
or
tar --use-compress-program=lz4 -cf archive.tar.lz4 stuff to add to archive
tar --use-compress-program=lz4 -xf archive.tar.lz4
lz4 has a command line structure similar to gzip. Therefore, something like this will work :
tar cvf - folderABC | lz4 > folderABC.tar.lz4
or
tar cvf - folderABC | lz4 - folderABC.tar.lz4
First one compresses silently, like gzip. Second one is a bit more lz4-specific, and will also display summarized compression stats.
To use -I in GNU tar, you must specify it AFTER destination file as this:
tar cvf /path/to/destinationfile.tar.lz4 -I lz4 /path/to/archive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With