LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-22-2007, 10:47 AM   #1
Rustylinux
Member
 
Registered: Mar 2006
Posts: 177

Rep: Reputation: 30
Help with Tar


Hello,

I forget what the command is if you want to extract a .tar.gz file with its file structure in tact. For instance say the tar file has a few folders and sub folders inside that I would like to be able to untar that with the file structure being created as it is doing so.

I have tried to tar -zxvf file1.tar.gz however it gives me the following error message.

tar: class/scalable/apps/gnome-session-halt.png: Cannot open: No such file or directory
tar: Skipping to next header
class/scalable/apps/gftp.png
tar: class/scalable/apps/gftp.png: Cannot open: No such file or directory
tar: Skipping to next header
class/scalable/apps/debian-logo.png
tar: class/scalable/apps/debian-logo.png: Cannot open: No such file or directory
tar: Skipping to next header

and so on and so on. I figure this is because it does not have the file structure it wants while extracting so it errors out. How would i extract this tar file so it creates the file structure it wants to extract to ?
 
Old 07-22-2007, 11:26 AM   #2
chuckbuhler
Member
 
Registered: Oct 2005
Distribution: SuSe
Posts: 95

Rep: Reputation: 17
It may be a corrupted tarball. Try running it with the -t switch, and see if it can list what's in it.

tar -ztf file1.tar.gz

That should list the contents, but not extract.

Another issue could be attempting to untar in a location that you don't have rights to.
 
Old 07-22-2007, 02:17 PM   #3
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,692
Blog Entries: 9

Rep: Reputation: 45
You probably have the "man pages" installed by default - so open a terminal and try
Code:
man tar
Theres a link in my sig about decyphering man pages.

regards

John
 
Old 07-22-2007, 05:45 PM   #4
Rustylinux
Member
 
Registered: Mar 2006
Posts: 177

Original Poster
Rep: Reputation: 30
Yes i have the man pages installed. I have read through the tar man page a few times but can't find a switch that will do what i'm looking for. I thought tar create the structure as needed depending on how it was tared but it doesn't seem to be working. I'm going to take another look at the permissions when i get home and also check to see if the tar is corrupt.

I don't think it is corrupt as a few of the tars are off www.gnome-look.org and I downloaded about 4-5. I coudln't see all of them being corrupt.
 
Old 07-22-2007, 06:08 PM   #5
jerril
Member
 
Registered: Nov 2005
Location: Ontario, Canada
Distribution: Linux Mint
Posts: 116

Rep: Reputation: 16
Some versions of tar are finicky about the dash in the options try it without the dash.


jer
 
Old 07-23-2007, 01:27 PM   #6
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
By default, GNU tar will recreate any needed directory structures. Are you sure you have permission to create directories in the directory you are in?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 02:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 10:55 AM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 02:53 AM
tar | ssh (tar > .tar) syntax issues EarlMosier Linux - Software 6 12-21-2006 12:28 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 06:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration