| | |
Need help uncompressing tar.gz file
Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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!
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!
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
----------------------------------------------
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
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.
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
----------------------------------------------
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
![]() |
Similar Threads
- What is Tar? (Cellphones, PDAs and Handheld Devices)
- Making installs through the source (*nix Software)
- Cannot install samba (*nix Software)
- make?? (*nix Software)
Other Threads in the Shell Scripting Forum
- Previous Thread: Urgent help: Wrong node routing agent
- Next Thread: Can anyone suggest some simple miniproject in C in Linux Environment
| Thread Tools | Search this Thread |






