Link
asked on
How to uncompress
Basically, I want to extract
1. tar file from sysdump.tar.gz............ (gzip -d sysdump.tar.gz)
2. extract all the tgz and other files from sysdump.tar from step 1 keeping destination folders .....................(tar xvf sysdump.tar)
3. from sysdump folder extract files from each of the 13 tgz files created from above step 2, again keeping dest folders. Here is where I get into trouble. I changed directory to sysdump and tried
for i in *
> do
> gunzip *.tgz | tar xvf $i
> done
I got all sorts of messages with:
"xxx.tar file already exists; do you wish to overwrite (y or n)? tar: tape blocksize error
tar: directory checksum error"
basically repeating itself, and not stopping for each y or n.
The loop I created was from my old notes from Unix and it's not working very well in this Linux environment. Can I get an expert to help me out to recursively extract all the tgz and gz zipped files keeping the original destination directories (and hang with me till it works?)
Thanks
1. tar file from sysdump.tar.gz............
2. extract all the tgz and other files from sysdump.tar from step 1 keeping destination folders .....................(tar xvf sysdump.tar)
3. from sysdump folder extract files from each of the 13 tgz files created from above step 2, again keeping dest folders. Here is where I get into trouble. I changed directory to sysdump and tried
for i in *
> do
> gunzip *.tgz | tar xvf $i
> done
I got all sorts of messages with:
"xxx.tar file already exists; do you wish to overwrite (y or n)? tar: tape blocksize error
tar: directory checksum error"
basically repeating itself, and not stopping for each y or n.
The loop I created was from my old notes from Unix and it's not working very well in this Linux environment. Can I get an expert to help me out to recursively extract all the tgz and gz zipped files keeping the original destination directories (and hang with me till it works?)
Thanks
So you have a sysdump.tar.gz that is containing 13 tgz files, right?
Try this:
gunzip sysdump.tar.gz
tar xf sysdump.tar
for a in *.tgz
do
tar zxf $a
done;
Try this:
gunzip sysdump.tar.gz
tar xf sysdump.tar
for a in *.tgz
do
tar zxf $a
done;
ASKER
On my system I can't use the z option on a .tgz file:
$ for a in *.tgz
> do
> tar zxf $a
> done
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq vw@[0-7]][ bfk][X...] [blocksize] [tarfile] [size] [exclude-file...] {file | -I include-file | -C directory file}...
$
If I gunzip first:
$ gzip -d *.tgz
then try xvf (not zxf)
$ for a in *.tar
> do
> tar xvf $a
> done
Then it works.
$ for a in *.tgz
> do
> tar zxf $a
> done
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
tar: z: unknown function modifier
Usage: tar {c|r|t|u|x}[BDeEFhilmnopPq
$
If I gunzip first:
$ gzip -d *.tgz
then try xvf (not zxf)
$ for a in *.tar
> do
> tar xvf $a
> done
Then it works.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
tar zxvf sysdump.tar.gz
(That will uncompress it into the current directory..)
Or if you want it somewhere else, add -C with the destination path after, i.e.
tar zxvf sysdump.tar.gz -C /desination/path
Cheers!