Extracting .tar file isn't working Extracting .tar file isn't working shell shell

Extracting .tar file isn't working


try the following command:

tar -xzvf filename.tar.gz


sudo tar -xvf filename.tar

This fixes two problems with the above tar -xv filename.tar.

1st Issue: Needed to include a the -f modifier for tar. Per [lowfatlinux][2], -f is a command for tar that says:

"The archive file name is given on the command line (required whenever the tar output is going to a file)"

Therefore, including the -f modifier tells the tar program that the file name supplied in the arguments is the file to extract from.

2nd Issue: Needed to append sudo to the beginning of the command, to give the shell permission to create directories


Try the following command:

gunzip -c filename.tar.gz | tar xopf -

After you tried gunzip, use tar xopf on that file

tar xopf filename.tar