PocketArC LogoPocketArC

xz and zstd are built into Ubuntu

tillinux

TIL xz and zstd are built into Ubuntu these days. In my head they're still "new" compression formats - I've used .gz plenty on servers over the years and never really ventured out. I've used zstd before on my Mac, but I had to brew install it. Never occurred to me that it'd just be there on a fresh Linux install.

# xz with multithreading (-T0 uses all cores) and fast compression (-1)
xz -T0 -1 ./dump.sql

# Decompress and pipe straight into mysql
xz -dc dump.sql.xz | mysql -u username -p database_name

# zstd with multithreading
zstd -T0 ./dump.sql

It's kind of like how we all still reach for JPEGs and PNGs despite the fact that WebP has been fully supported in browsers for over half a decade now. Old habits die hard.