Unable to extract .gz file using gunzip

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Unable to extract .gz file using gunzip
# 1  
Old 01-23-2017
Unable to extract .gz file using gunzip

Linux 3.8.13-16.2.1.el6uek.x86_64 #1 SMP Thu Nov 7 17:01:44 PST 2013 x86_64 x86_64 x86_64 GNU/Linux

Hi all,

I am unable to extract .gz file using gunzip

Used the following command to create the .gz file:

Code:
nohup tar -cvpf - 11.2.0.4  | gzip -c > /u01/Test_hot_1222017/11.2.0.4_OH_Bkp_1212017.gz &

I get the file created as

Code:
-rwxrwxrwx 1 oratst dba 5466458195 Jan 21 06:08 11.2.0.4_OH_Bkp_1212017.gz

Now, when I gunzip the file to extract the file contents, I get the following message:

Code:
-bash-4.1$ gunzip 11.2.0.4_OH_Bkp_1212017.gz | tar xvf -
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

Please advise how to extract the 11.2.0.4_OH_Bkp_1212017.gz file?

Thanks for your help and time!

Regards,
# 2  
Old 01-23-2017
Code:
gunzip filename

does not print to stdout, that unzips the file itself on disk without printing its contents.

You may try gunzip < filename | tar ... but I suspect the gz is not there any more, and just tar ... < filename will do.
# 3  
Old 01-24-2017
You might also look in your manual pages for tar and see if the -z flag is supported. This will allow you to write/read gzip format compressed archive files in one command rather than piping a tar into/from a gzip.



Robin
# 4  
Old 01-26-2017
Try this.

Code:
gzip -dc 11.2.0.4_OH_Bkp_1212017.gz | tar -xvzf -

Cheers...!


Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 01-27-2017 at 04:22 AM.. Reason: Added CODE tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Gunzip: File too large error

Hello All, I'm trying to write a script to load the MySQL DB from a dump file but the unzipping doesnt seem to work, not sure whats the issue, i get below error bash>gunzip mysql2-dump.gz gunzip: mysql2-dump: File too large bash > can anyone pls let me know how to sort this out? ... (2 Replies)
Discussion started by: Mahesh_RPM
2 Replies

2. Shell Programming and Scripting

Gunzip a file in UNIX

hi All, i have a file called rsync-3.0.9.tar.gz, i have to unzip and then uncompress it. but at first while i am trying to unzip this file, it is giving me following error: -rw-r--r-- 1 bravodba bravodba 7278458 Aug 19 08:26 rsync-3.0.9.tar.gz bash-3.2$ unzip rsync-3.0.9.tar.gz Archive: ... (12 Replies)
Discussion started by: lovelysethii
12 Replies

3. Shell Programming and Scripting

Not able to gunzip a .gz file, in ksh

i am working on unix - ksh trying to unzip a .gz file and when i executed the below, in my command prompt in ksh gunzip abc.gz it was throwing the message below: gunzip: abc.gz: unexpected end of file - pls advise what is the reason for it..i am pretty sure the .gz file had no issues. (3 Replies)
Discussion started by: billpeter3010
3 Replies

4. Shell Programming and Scripting

FNR>2 is not working and unable to extract data from a file

Hi, I have a file in windows environment and moved to UNIX through FTP (ASCII format). The file is having with tab delimited file. awk ‘FNR>2' file_cust*.txt >>filnal.txt I have the same file in production; it is working fine with the same procedure. Once we receive the file in windows... (1 Reply)
Discussion started by: onesuri
1 Replies

5. UNIX for Dummies Questions & Answers

Unable to extract bz2-00 file

I have a file having name smthing.tar.bz2-00 I am trying to unzip it using tar -xvjf "name" But I am not able to unzip it. PLease advise for the issue. (3 Replies)
Discussion started by: nixhead
3 Replies

6. AIX

Unable to gunzip .tgz file in AIX6.1

Hi guys, This is my 1st post here. I tried to Google around but failed to get my solution. So I hope you guys could help me. (I have just a basic unix background for 2years so I'm sorry if im asking stupid questions) OS - Aix 6.1, 64 bits. Server - currently I only have telnet access to a... (12 Replies)
Discussion started by: pilotHans
12 Replies

7. UNIX for Advanced & Expert Users

unable to extract Trademark(™) Character

Hello All, I am trying to extract a trademark character (™) from a varchar column in a DB2 Table. The result is to be placed in a sequential file in an AIX environment. After the Extraction is complete when I view the extracted file I noticed that in place of the (™) Character another... (5 Replies)
Discussion started by: cosec
5 Replies

8. UNIX for Dummies Questions & Answers

Using gunzip to decompress .zip file

Hi, I have a zipped Oralce software (linux.x64_11gR1_database.zip) and I need to unzip it. On the Linux server, I only see the gunzip utility listed: $ ls -ltr *zip* -rwxr-xr-x 3 root root 60320 Jan 15 2008 gzip -rwxr-xr-x 3 root root 60320 Jan 15 2008 gunzip Can I use the command... (1 Reply)
Discussion started by: syang68
1 Replies

9. UNIX for Advanced & Expert Users

gunzip: unexpected end of file

Ok, I sent several gzipped files using the UNIX "mail" utility without any special settings (bad idea). When I saved these files from my mail and tried to gunzip them, I would get something like the following error: gunzip: wmGrep.mel.gz: unexpected end of file Ok, I messed up. But is it... (4 Replies)
Discussion started by: sicjedi
4 Replies

10. UNIX for Dummies Questions & Answers

Gunzip : unexpected end of file

Hi, While uncompress , gunzip filename.cpio.gz getting the fg. error gunzip: filename.cpio.gz: unexpected end of file. Whats the problem? Size of this .gz file is 660mb . Thanks, (1 Reply)
Discussion started by: Dolly
1 Replies
Login or Register to Ask a Question