compressiontarlz4

How to use tar with lz4?


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


Solution

  • 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.

    Decompression would go like this :

    lz4 -d folderABC.tar.lz4 -c | tar xvf -