I know how to compress a directory with xz using tar, but is it possible to compress a directory using xz WITHOUT tar?
If I try:
xz -z myDir
Then the following error is retured:
xz: myDir: Is a directory, skipping
xz
, like compress
, gzip
and other Unix-style compressors, is a single-file compressor: it outputs .xz
files which are always decompressed to a single file.
Because of that, compressing directories or multiple files requires a container of some sort (if you want to be able to recover the separate files). That’s typically a tar
archive, but it could be a cpio
archive or some other format.
7z
. The world doesn't revolve around XZ. – Artem S. Tashkinov May 16 '23 at 20:39