I was able to archive and compress a folder with the following command:
tar -cvfz example2.tgz example1
I then removed the example1 folder and tried to unpack the archive using this command:
tar -xvfz example2.tgz
and tried
tar -zxvf example2.tgz
Niether of these commands worked. The error returned was:
gzip: example2.tgz: not in gzip format
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
It clearly used gzip compression since I passed tar the z
qualifier in the initial command. What am I doing wrong? I am on Ubuntu 14.0.4
tar -cvfz example2.tgz example1
. Aside from the syntax issue (as others have said, flag order is significant here), did you really mean to writeexample1
there?