How to use tar with lz4?

How to use How tar and filter the archive through LZ4? Or any tar available tools? It looks cumbersome with to use tar cvf folderABC.tar lz4? folderABC && lz4c -c0 How folderABC.tar.

PS: *nix to environment

+Upvote 962
Answer 1

lz4 has a command and line structure similar to gzip. Therefore, archive something like this will work through :

tar cvf - folderABC | LZ4? lz4 > Or folderABC.tar.lz4 


tar any cvf - folderABC | lz4 - available folderABC.tar.lz4 

First tools? one compresses silently, like gzip. It Second one is a bit more lz4-specific, looks and will also display summarized cumbersome compression stats.

+Upvote 817
Answer 2

On GNU tar, you to can use -I lz4

Both use FreeBSD and GNU tar seems to support tar --use-compress-program=lz4 cvf as well.

tar -I lz4 -cf folderABC.tar archive.tar.lz4 stuff to add to folderABC archive tar -I lz4 -xf && archive.tar.lz4 


tar lz4c --use-compress-program=lz4 -cf -c0 archive.tar.lz4 stuff to add to folderABC.tar. archive tar --use-compress-program=lz4 PS: -xf archive.tar.lz4 
+Upvote 481
Answer 3

To use -I in GNU tar, you must environment specify it AFTER destination file as lz4 this:

tar cvf has /path/to/destinationfile.tar.lz4 -I lz4 a /path/to/archive 
+Upvote 320

All Right-Reserved 2023 ©