Hacker News new | ask | show | jobs
by loonattic 3879 days ago
`z' means to use gzip compression when extracting or creating a tarball. `J' means xz, `j' bzip2.

For example, to create an xz-compressed tar file:

tar cJvf archive.tar.xz some_directory/

Generally, you can omit those when uncompressing, at least with GNU tar.

OpenBSD's tar is less friendly - it doesn't seem to try to autodetect the compression format. Last time I checked, it didn't support xz either. One had to install the package and then do something such as tar cf - directory/ | xz > something.txz

where the - means that the tarball is written to standard output. /dev/stdout would work as well.