7 ms·
tar makes a lot more sense if you use long options instead of completely cryptic short ones. tar command I've been using recently (scripted of course): To com
by shmerl 9y ago
tar makes a lot more sense if you use long options instead of completely cryptic short ones.
tar command I've been using recently (scripted of course):
To compress:
tar --create --verbose --use-compress-program="pixz" --file foo.tar.xz --directory <bar_dir> .
To extract:
tar --extract --verbose --use-compress-program "pixz -d" --file foo.tar.xz
Unlike bz2 or xz, pixz it uses all CPU cores both for compression and decompression, and as well allows extracting individual files fast. It's also compatible with xz itself.
- gboudrias 9y agoBy the way, at least for the ones I've tried, --extract now figures out the compression algorithm, so --use-compress-program is possibly redundant. With the cryptic short options it's only one letter, but I find it makes it easier to remember a distinct "4-letter scrabble" for creation versus a "3 letter scrabble" for extraction. (For the long options you save a lot of typing!)
- shmerl 9y agotar wouldn't be able to figure out to use pixz instead of xz in this case just using implicit deduction. I don't really type those options, but use some simple wrapper scripts :) Something like pixzcompress / pixzextract. Scripts also take care to differentiate between directory and a single file.
- imiric 9y agoIf you're OK with wrapper scripts, take a look at dtrx[0]. It can extract many different formats, so assuming you have the tools already installed, extracting anything can be done with `dtrx <filename>`. [0]: https://brettcsmith.org/2007/dtrx/ https://brettcsmith.org/2007/dtrx/
- shmerl 9y agoInteresting, but pixz is too new for it, plus it looks like it's using extension to determine the type, so it won't work for the same reason as above. The benefit of pixz is much faster compression / decompression.
- digi_owl 9y agoThere is also atool. http://www.nongnu.org/atool/ http://www.nongnu.org/atool/
- gboudrias 9y agoGood to know, thanks! :)
- deleted 9y ago[deleted]