Extract and Compress
It's hard to remember which commands to use to extract the various compressed archive formats.
extract command to extract
.pax archives. For example:
Similarly, the syntax for compressing files and directories is neither consistent nor particularly memorable.
Provided you have
xz installed, you can compress a single file or directory (as
*.txz, respectively) via the following simple command:
The archive will be created in-place unless a destination is specified, as shown via this example:
compress your-directory ~/your-new-archive.txz
Mac OS X users: You should install GNU Tar via
brew install gnu-tar, since the bundled version of
tar is ancient and doesn’t support
Extra Bonus: Parallel Compression and Extraction
If you have pixz installed, both compression and extraction of
xz archives will be processed in parallel on multi-core systems. This usually results in a dramatic increase in compression/extraction speed.
pixz on Mac OS X via Homebrew:
brew install pixz gnu-tar
pixz on Debian/Ubuntu`:
sudo aptitude install pixz