Hacker News new | ask | show | jobs
by Baal 2863 days ago
No need for the ā€˜z’ :)
2 comments

Yeah, tar is actually pretty simple these days. (At least GNU tar, don't know about other tars.) In 99.9% of cases you only need to know the following:

  tar caf $archive $file...      to create
  tar xf $archive                to extract
"x" will automatically recognize the compression format, and "ca" will automatically infer the desired compression format from the extension in $archive, e.g.

  tar caf backup.tar.xz /home/user
makes an xz-compressed tarball.
I still prefer to pipe through a compression program on principle. tar has no good reason to messing around with compression, per the Unix single-function philosophy.
to people who grew up with archive programs, "making all of this into a single file" and "compressing all of this" is the same thing; requiring two commands is counterintuitive
tar has trained us so well: "... tar is actually pretty simple these days"
You need it if you're processing stdin (curl ...file.tgz | tar xz)