I was able to archive and compress a folder with the following command:tar -cvfz example2.tgz example1I then removed the example1 folder and tried to unpack the archive using this command:tar -xvfz example2.tgz and triedtar -zxvf example2.tgz Niether of these commands worked. The error returned was:gzip: example2.tgz: not in gzip formattar: This does not look like a tar archivetar: Exiting with failure status due to previous errorsIt 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
can't decompress .tgz using gunzip
linux;ubuntu;tar;gzip
The command you're showing in your first line (tar -cvfz example2.tgz example1) doesn't work and it should not output any file example2.tgz. Didn't you get an error? Perhaps the file example2.tgz existed already? Check if you have a file called z in that folder - that's where the tgz has been saved to, because:The -f parameter specifies the file which must follow immediately afterwards: -f <file>Try  tar cvzf exam.tgz example1