Need help uncompressing tar.gz file

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Need help uncompressing tar.gz file

 
0
  #1
Feb 14th, 2007
Hey, I hope I'm posting this in the right forum. I'm compressing a bunch of files to tar.gz, then uploading them to my webhosts ftp server, and then trying to uncompress them on my server using a php script that enables me to run some shell commands (since we don't have shell access).

The command I'm using right now is "tar xzf archivename.tar.gz"

The problem with this is, the archive consists of files within directories, within directories. But when I extract them, it extracts everything to the same directory, and appends the directory path to the file names, rather then putting them all in their own directories.

What command do I use to extract them while keeping the directory structure in place?

Thanks!
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,426
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 258
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Need help uncompressing tar.gz file

 
0
  #2
Feb 14th, 2007
tar keeps the directory path in place by default. This behaviour that your describing would be very unusual for a tar command. Something special is being done, probably an alias replacing tar with a special call (although I don't know of any options to tar that would cause this behaviour), or some options were used (again I don't any , but then again I have only Sun's tar for comparison and Gnu's tar has many more options) on the packaging tar command that caused this.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: Need help uncompressing tar.gz file

 
0
  #3
Feb 14th, 2007
It very well could be the app I'm using to package the tar in the first place that is causing the problem. It has absolutely no options at all. The app I'm using is free and can be obtained here. You simply drag and drop the files you want to compress onto the box, and that's it. No options at all. Any suggestions for a good free app to do it? Maybe that's my problem.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,426
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 258
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: Need help uncompressing tar.gz file

 
0
  #4
Feb 15th, 2007
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 8
Reputation: kishore5001 is an unknown quantity at this point 
Solved Threads: 0
kishore5001 kishore5001 is offline Offline
Newbie Poster

Re: Need help uncompressing tar.gz file

 
0
  #5
Feb 26th, 2007
Hi

May be this command : Try this

tar -zxvf filename.tar.gz
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: Need help uncompressing tar.gz file

 
0
  #6
Feb 26th, 2007
thanks guys. I actually found that powerarchive works great.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Shell Scripting Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC