r/programming • • Mar 12 '21

7-Zip developer releases the first official Linux version

https://www.bleepingcomputer.com/news/software/7-zip-developer-releases-the-first-official-linux-version/
5.0k Upvotes

377 comments sorted by

View all comments

Show parent comments

49

u/futlapperl Mar 12 '21

.xz doesn't seem to be an archive format, instead only supporting single files, so you have to .tar everything first. This explains the common .tar.xz extension. 7z combines those two steps, but so does every other archiving program. Not sure if there are any notable advantages.

130

u/Kissaki0 Mar 12 '21

A 7z will not retain Linux file permissions.

Combining tar with an additional compression is prevalent on Linux. It's also in line with the Unix philosophy of combining/piping programs together.

Tar has a parameter to do the xz step too on compression, and it's no problem on extraction either. So really it's mostly transparent to the user that it's a two layered file compression.

32

u/futlapperl Mar 12 '21

A 7z will not retain Linux file permissions.

Ah, interesting! That's useful to know.

And yeah, I agree, tar sticks to the Unix philosophy of "Do one thing, but do it well." better than 7z.

17

u/Kissaki0 Mar 12 '21

And yeah, I agree, tar sticks to the Unix philosophy of "Do one thing, but do it well." better than 7z.

It’s kind of ironic though how in the next sentence I said tar can do that with a parameter. ;-)

Manually piping and combining things is not very viable to end users. A parameter on a program is much easier to use. Even if the technical implementation will be separated again, the user interface isn’t. I don’t even know if tar embedded the other compression libs statically or uses shared libs or the other binaries.

40

u/Tm1337 Mar 12 '21

I don't want to shoehorn this in, but it is as relevant as it gets.

https://xkcd.com/1168/

6

u/4lteredBeast Mar 13 '21

Funnily enough, xkcd looks like a bunch of parameters you feed the tar command

24

u/barsoap Mar 12 '21

It took literal ages until GNU came around and made tar's x option auto-detect the presence of compression. Before that you had to additionally specify z or j for gz and bzip2, xz is J I think auto-detect has been available for about as long as that.

Hmm. I just tried it, at some point it must also have stopped to operate on /dev/tape if you don't specify a file.

→ More replies (7)

12

u/dreamer_ Mar 12 '21

Manually piping and combining things is not very viable to end users.

Depending on the end user of course ;)

  • Advanced user or developer might need a separate compressor program. Example: when my CI generates extremely large logs, I can just xz them (without tar) - they will be tiny again, because text files compress nicely, and vim will open them anyway (it will decompress them in-memory, I don't need to do it myself).

  • Normal GUI user on Linux does not need to worry about tar, xz, or piping at all. In Gnome: right click on a directory -> Compress -> select .tar.xz -> click "Create"

2

u/Kissaki0 Mar 12 '21

Convenience parameters for combined functionality or piping is not the same as using other programs though. I was talking about the first.

If you have a use case for using a different program of course you just use that. You do not need a parameter on tar for that.

0

u/[deleted] Mar 12 '21

I expect you’re probably a power shell user or somebody who doesn’t use the command line much. Pipes in bash/zag are great and I use them every day.