If a particular archive type has to be converted into another format (eg – tar.gz
to zip
), then one can open the archive using file-roller
and go to –
Archive -> Save As -> (select the extension) -> Save
Also, in this method, Other Options can be used to set a password for the zip
file, which is not possible in case of tar.gz
files using file-roller
.
How can the above steps be performed using the command line?
Best Answer
Basic Shell commands:
At this point you have a copy of the contents of
archive.tar.gz
in $HOME/tempdir/... will create a zip archive from the contents of tempdir/ and then remove the files added. I presume it still does;
use standard (weak) PKZip 2.0 encryption
as stated for the-e
option - which doesn't take the password, but prompts for it instead.Make SURE / VERIFY you're still in tempdir/
If there is ANYTHING else than "/tempdir" at the end above,
then DO NOT continue with what comes next, here:
All the above might be possible with a pipe too, as in:
... I see no reason to try it out though - due to the weak encryption and possible problems with how zip handles special files, links and whatnot.
If you want real encryption, look into
gnupg
and related utilities instead.man tar
,man zip
,zip --help
,zip -h2 | less
,tar --help | less
may hold information vital to the above, especially the piped conversion which I have not tried.