What invocation will use LZMA to compress tar output on my Mac (OSX 10.12.x)?
When using tar
, the first word after -f
is the output filename. In your case, switching the order of options might be enough:
tar -c --lzma -f foo.tar.lzma sourcefile(s)
Related videos on Youtube
Christos Hayward
Updated on September 18, 2022Comments
-
Christos Hayward over 1 year
I've tried several invocations of the OEM tar to create LZMA-compressed tarballs. More specifically, I tried:
tar -c -f --lzma Windows\ 7.vmwarevm.tar.lzma Windows\ 7.vmwarevm
My efforts created an archive with filename
--lzma
, and tar complained ofWindows 7.vmwarevm.tar.lzma
:Cannot stat: No such file or directory
, probably for the same reason:--lzma
was taken as the filename of the archive to be created, and consequently the actual intended archive name was taken to be the first in a list of arguments to include in the archive.I thought after some searching that MacOS had not included it in the provided options, and built GNU tar from scratch, storing it under another name in
/usr/local/bin
. However, my efforts to use the above invocation with the renamed and newly builttar
had the same effect: I was building an archive in--lzma
.My computer has a seemingly working
/usr/local/bin/lzma
.What invocation(s) should I use, perhaps piping
tar
tolzma
and perhaps in a script to do the work of "tar czf foo.tgz foo", but useslzma
instead ofgzip
for compression?-
Christos Hayward over 6 yearsThank you; please restate your comment as an answer so I can accept it.
-