Help with gunzip


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with gunzip
# 1  
Old 06-03-2010
Help with gunzip

Hi All,

I have a file "HOTEL_INFO.zip" and getting the below errors:

Code:
 
server1:/home/arun# gunzip -S .zip HOTEL_INFO.zip
gunzip: HOTEL_INFO.zip: first entry not deflated or stored -- use unzip

 
server1:/home/arun#unzip HOTEL_INFO.zip
ksh: unzip:  not found.
 
server1:/home/arun#gunzip HOTEL_INFO.zip
gunzip: HOTEL_INFO.zip: unknown suffix -- ignored

i believe this is something we play around with ulimit.

server1:/home/arun# ulimit -a
time(seconds) unlimited
file(blocks) 2097151
data(kbytes) 131072
stack(kbytes) 32768
memory(kbytes) 32768
coredump(blocks) 2097151
nofiles(descriptors) 2000

and changing the attribute file = unlimited will resolve the purpose and so i can gunzip the .zip file using the below command successfully:

Code:
 server1:/home/arun# gunzip -S .zip HOTEL_INFO.zip

Please advise whether ulimit -f unlimited is the appropriate command as to execute from 'root' id? since i dont have authorization to perform this action.

Or advise me, which is the appropritae command/what actually restricting me from ding this?

FYI, the user id here is LDAP maintained and not local.

Thanks.

Last edited by Arunprasad; 06-03-2010 at 07:52 AM.. Reason: forget to add one more point
# 2  
Old 06-03-2010
gunzip will uncompress the file which was previously compressed with gzip, and has a ".gz'' extension.
The !gunzip Command: Uncompress Files

.zip file can be unzipped in other ways. Which OS are you using?
# 3  
Old 06-03-2010
Hi Hari,

Thanks a lot for the info!
It seems the !gunzip also works with ".gzip" or ".gz" file. And i surfed around and found that

Code:
gunzip -S .zip HOTEL_INFO.zip

this command will work but got error.

I believe this is something i need to do with ulimit. i suspect that i need to change the file(blocks) unlimited by the command:

Code:
ulimit -f unlimited

correct me if i am wrong and also advise how a root id can perform this change to unlimited (using what command) and advise is tere any other way to get it done.

Thanks!

Last edited by Arunprasad; 06-03-2010 at 09:50 AM.. Reason: forget to add code tags
# 4  
Old 06-03-2010
Quote:
Originally Posted by Arunprasad
Hi Hari,

Thanks a lot for the info!
It seems the !gunzip also works with ".gzip" or ".gz" file. And i surfed around and found that

Code:
server1:/home/arun# gunzip -S .zip HOTEL_INFO.zip
gunzip: HOTEL_INFO.zip: first entry not deflated or stored -- use unzip


From the gunzip, man page,

Code:
      Files created by zip can be uncompressed by gzip only if they have a
      single member compressed with the 'deflation' method. This feature is
      only intended to help conversion of tar.zip files to the tar.gz
      format.  To extract a zip file with a single member, use a command
      like gunzip <foo.zip or gunzip -S .zip foo.zip.  To extract zip files
      with several members, use unzip instead of gunzip.


you seems to be root, its easy to install unzip.
Or check if its available on any other server (probably linux) . If so, ftp the file, extract it with unzip and zip again with gzip. and send back to the server1.
# 5  
Old 06-03-2010
If you have java installed on ur server you can use ' jar' to unzip the .zip file:

Ex: /opt/java1.5/bin/jar –xvf HOTEL_INFO.zip
# 6  
Old 06-04-2010
Hi All,

Really thanks a lot for your help!
I think i have diverted you. Here is the output for your suggestions:

1. server1:/home/arun# gunzip < HOTEL_INFO.zip
gunzip: stdin: first entry not deflated or stored -- use unzip

i am not root user and i am not able to install unzip. i thought if i change file(blocks) listed in ulimit -a to be 'unlimited' then i can run the above gunzip commands. So to achieve this is the following command is correct?

Code:
ulimit -f unlimited

but to execute this command i dont have access. Only root can perform. So just curious to know how a root user will perform this change. Please advise.

2. Sorry, i dont have java.

Please help me... Thanks again!

---------- Post updated 06-04-10 at 03:33 PM ---------- Previous update was 06-03-10 at 07:04 PM ----------

Hi Al,,

I have one more question...

when i am able to create a file around 10GB then why such unzip/gunzip is not allowing me to perform even the file is less than 4GB .... (the data are just an example) and say expanding the zipped file will be 10 GB which is originally i created.... it should not be that my original size and this ulimit size should be same?

please advise me on this also.

Last edited by Arunprasad; 06-04-2010 at 04:45 AM..
# 7  
Old 06-04-2010
Hi.

If you are comfortable downloading programs, p7zip may be of interest to you. In almost all *nix systems you can have local programs -- in your HOME directory structure -- you do not need to install them in system areas.

Here's an example of creation of a zip file and extraction with p7zip (for me, p7zip was in my Debian repository):
Code:
#!/usr/bin/env bash

# @(#) s1	Demonstrate uncompress, extract of zip archive with p7zip.
# 7zip: http://p7zip.sourceforge.net/

pe() { for i;do printf "%s" "$i";done; printf "\n"; }
pl() { pe;pe "-----" ;pe "$*"; }

rm -f t1 t2 t1.zip
FILE=${1-data1}

pl " Data file $FILE:"
head -20 $FILE

pl " Created zip file:"
cp $FILE t1
zip t1.zip t1
file t1.zip
ls -lgG t1 t1.zip

pl " Unzip with 7z:"
7z e -so t1.zip > t2
ls -lgG t2

pl " Compare files:"
if cmp --quiet t1 t2
then
  pe " Files have identical content."
else
  pe " Files differ, details:"
  diff t1 t2
fi

exit 0

producing:
Code:
% ./s1

-----
 Data file data1:
Albuquerque, N.M.
Arlington, Texas
Atlanta, Ga.
Austin, Tex.
Baltimore, Md.
Boston, Mass.
Charlotte, N.C.
Chicago, Ill.
Cleveland, Ohio
Colorado Springs, Colo.

-----
 Created zip file:
  adding: t1 (deflated 21%)
t1.zip: Zip archive data, at least v2.0 to extract
-rw-r--r-- 1 160 Jun  4 09:37 t1
-rw-r--r-- 1 262 Jun  4 09:37 t1.zip

-----
 Unzip with 7z:

7-Zip  4.58 beta  Copyright (c) 1999-2008 Igor Pavlov  2008-05-05
p7zip Version 4.58 (locale=C,Utf16=off,HugeFiles=on,1 CPU)

Processing archive: t1.zip

Extracting  t1

Everything is Ok

Size:       160
Compressed: 262
-rw-r--r-- 1 160 Jun  4 09:37 t2

-----
 Compare files:
 Files have identical content.

See the sourceforge URL noted in the script. Best wishes ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

gunzip status

Hi, I'm trying to run my application on HP-UX server. I have to extract a *.tar.gz file. I'm doing that now in 2 steps. first I gunzip it and then pax it. My question is how can I check whether the data in the *.tar.gz file is corrupted or not?? Now, I'm trying to do this... (1 Reply)
Discussion started by: Kyaw Lwin Phyo
1 Replies

2. Shell Programming and Scripting

Gunzip files

Hi ALL, Am working with the gunzip command to zip all the old files having 10 days am using the command find . -name '*.log' -type f -mtime +10 -exec gunzip {} \; am facing two issues 1.)it displays the files which are all older than a year 2.)when am trying to gunzip all the... (2 Replies)
Discussion started by: thelakbe
2 Replies

3. SCO

gunzip problem

hi On one of our SCO 5.0.6 server gunzip doesn't work and I'm getting this error message: # gunzip dynamic linker: gunzip: symbol not found: ___requires_updated_system_library_se_ Killed What's missing? (0 Replies)
Discussion started by: ccc
0 Replies

4. Shell Programming and Scripting

Gunzip files

Hello Everyone, I have a few files in a directory such as : abc.xyz.txt1.gz abc.xyz.txt2.gz .... .... ... ... abd.xyz.txt100.gz And I want uncompressed files such as: abc.xyz.txt1 abc.xyz.txt2 .... ... ..... .... (1 Reply)
Discussion started by: ad23
1 Replies

5. UNIX for Dummies Questions & Answers

gunzip

I have a zip file as a.zip and it contains 1m xml files. like a1.xml, a2.xml.... The size is also very big nearly 1GB. I want to extract only a123.xml. Can any one help how can I do this? (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

6. Shell Programming and Scripting

Help on gunzip

Hi All, I am using UNIX command to unzip the files gzip -d9 DW_*.gz The Xmls are compressed using gzip and it is received in the .gz format at UNIX box which need to be uncompressed. The above command is working fine for 400 compressed xmls(.gz files) but when the count becomes 401 or more i... (7 Replies)
Discussion started by: Codesearcher
7 Replies

7. UNIX for Dummies Questions & Answers

gunzip syntax help

Hi All, I am a newbie to unix and need help. I am trying to unzip the files in source library to destination library. the input filename can be any thing with abc and after unzip, i want the same file name with original extension suppose,the input file is ABC_jun25.dat.gz after gunzip in the... (1 Reply)
Discussion started by: onlyjayaram
1 Replies

8. UNIX for Dummies Questions & Answers

gunzip question

unzip test.zip ==> This uncompresses and keeps the original zip file. gunzip test.gz ==> Removes the .gz file after uncompressing. Is there any switch to make the .gz file available after uncompression. Thanx in advance. (3 Replies)
Discussion started by: devs
3 Replies

9. UNIX for Dummies Questions & Answers

Gunzip

Hi can't unzip a gz file in TurboLinux 7.0 when i'm trying this gunzip filename.tar.gz it always says not in gzip format what should I do...please help me (4 Replies)
Discussion started by: CreamHarry
4 Replies

10. UNIX for Dummies Questions & Answers

gunzip....problem

Hi........... i have downloaded...sunscreen3.1 lite frm sunfreeware .com and it is in tar.gz format..so i download gzip also... now pls tell me how to install gzip and how to unzip tht sunscreen tar.gz file..............after unzipping i have to untar the tar file or not.....pls tell me in... (2 Replies)
Discussion started by: Prafulla
2 Replies
Login or Register to Ask a Question