Comment by mkl
I tried it to check before making the comment. In Ubuntu 25.04 it does not automatically enable compression based on the filename. The automatic detection when extracting is based on file contents, not name.
I tried it to check before making the comment. In Ubuntu 25.04 it does not automatically enable compression based on the filename. The automatic detection when extracting is based on file contents, not name.
If you add a for auto, it will choose the right compression based on the file name.
tar -caf foo.tar.xz foo
Will be an xz compressed tarball.