You can use tar's -I option specifying the "compression program":
tar -cvf archive.lz -I 'lzip -9' file1.txt file2.txt
Or you can pipe tar's output through lzip:
tar -cvf - file1.txt file2.txt | lzip -9 > archive.lz
Both options are described in the GNU tar manual (search for the first -I).
With tar's -tvf options, you can list the contents of any archive created with tar, even in combinations with other libraries like gzip, bzip2, or xz.
tar -tf file.tar
tar -ztf file.tar.gz
tar -jtf file.tar.bz2
tar -Jtf file.tar.xz
Listing the contents allows you to specifically identify the file you want to extract from the achive, and then you can use ...
...have to decompress everything to extract any file... Right?.
not if you avoid tar; searching file names, and extracting a single file from an archive is easy (and fast with .zip, .7z). Example;
> du -h a.*
> 7z l a.7z |...
The -v option increases tar’s verbosity. The default verbosity depends on the command.
-t lists the file names contained in the archive. One -v adds ls -l-style file details.
-c and -x don’t output anything by default. One -v makes them behave like -t, listing the file names only; two -vs adds the file details.
You can add up to three -v options:
I wrote a quick script to recursively check each file in a directory and then only compress the most compressible files. It grabs a couple of megabytes in the interior of the file and tests them with gzip --fast, then it uses xz to compress the file if needed.
You can run it with: ./compress.if.compressible dir_name
cores=$(grep '^core id' /proc/cpuinfo | ...