Extracting .tar file does not work

Thank you for your help! As a novice user, I really appreciate the help!


My machine / OS: Mac OSX 10.5.8, 32-bit


What I'm trying to do: Uninstall and install Apache Maven from the website.


What I did: I downloaded the binary.tar.gz file from the website and, using the shell, moved the downloaded file to the appropriate directory and extracted .tar from .tar.gz using gunzip -v filename.tar.gz , resulting in a file .tar. Now I am trying to extract the .tar file using tar -xv filename.tar .


My problem Mining doesn't seem to work! After I typed the tar -xv filename.tar command and hit enter, the shell does not return any output and does not seem to complete the extraction. It remains undefined with an empty string returned after pressing input.


My attempts Studying the directory from another Shell window, both while tar running, and after exiting the shell during the execution of the process, changes to the files are not displayed; i.e. the only file / directory is the source .tar.gz file. I also tried to delete the file along with the directory containing it, recreate the directory, copy the file to the directory again, and try the tar -xv filename.tar command again. The result is the same


Thank you all!

+4
source share
4 answers

try the following command:

 tar -xzvf filename.tar.gz 
+10
source

sudo tar -xvf filename.tar

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

1st Issue: You must enable the -f modifier for tar. Per [lowfatlinux] [2], -f is a command for tar that states:

"The name of the archive file is specified on the command line (required whenever tar output is output to the file)"

Therefore, including the -f modifier, tells tar that the file name provided in the arguments is the file from which it is extracted.

2nd Issue: add sudo to the beginning of the command to allow the shell permission to create directories

+4
source

Try the following command:

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

After you tried gunzip, use tar xopf in this file

 tar xopf filename.tar 
+1
source

Your download is likely to have been corrupted, pay attention to what it says on the website:

NOTE. The following links list you with the various mirrors available. DO NOT USE these links directly.

This mirror worked for me on Debian:

wget http://www.us.apache.org/dist/maven/binaries/apache-maven-3.0.4-bin.tar.gz
tar -xvzf apache-maven-3.0.4-bin.tar.gz

0
source

All Articles