Re:The growth of command-line options, 1979-Present
by OskarS on Tuesday March 03, 2020 @11:22AM
(#22475860)
That's true, and it's nice that it works, but it's just more magic information you have to memorize about tar. And it works one way but not the other. What is the flag for creating the archive compressed with bzip2? Without looking it up? I have no idea. "b" maybe? Does the file name come before the folder name, or is it vice versa? Who knows.
How about:
tar c folder | bzip2 > folder.tar.bz2
I didn't have to look any of that up.
Re:The growth of command-line options, 1979-Present
by eMSF on Tuesday March 03, 2020 @11:51AM
(#22476196)
The file name's position is not magical; it's linked to the -f flag.
tar -c [files...] -f archive.tar
The thing is, for both basic compressing and decompressing you don't actually have to memorize all that much: tar xf archive.tar.gz # to uncompress
tar caf archive.tar.ext [files...] # to compress
(One could argue that for symmetry you might want to use xaf instead of xf.)
Perhaps you mean that you've looked it up. Others could do so, too; it's not that hard (even if a web comic makes light-hearted fun of the subject)!
Anyway, here's a fun fact: tar is smarter than you give it credit. The commands below do just work: