Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can't untar a complete directory using tar -cvpzf

Tags:

linux

gzip

tar

Banging my head on this one...

I used tar -cvpzf file.tar.gz to compress a complete directory.

I move the file to another server and i try to decompress the directory where i have copied the archive. Can't make it work.

bash-3.2$ tar -xvpzf news.tar.gz .       
tar: gzip: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: .: Not found in archive
tar: Error exit delayed from previous errors

Anyone ?

like image 855
Bernard Sfez Avatar asked Mar 17 '12 11:03

Bernard Sfez


People also ask

What does the command tar XVZF * .tar do?

gz using option -xvzf : This command extracts files from tar archived file. tar.

How do you untar a directory in Linux example?

Untar single specified directory or file in Linux This option is used to untar any file in our current directory or inside the specified directory with the -C option. The command is as follows: $ tar -xvf file. tar -C file's path in the directory.


1 Answers

Your tar can't find gzip. If you don't have gzip, you can't make a .gz file. You should look for a gzip executable on your system. What kind of system is it?

In the meantime, you could leave off the "z" and just transfer a .tar file. It will be bigger, but at least you'll be able to move your data to the other server.

like image 93
Mark Adler Avatar answered Sep 20 '22 22:09

Mark Adler