7z command for files larger than 4GB ( unzip doesn't work)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers 7z command for files larger than 4GB ( unzip doesn't work)
# 1  
Old 11-04-2014
7z command for files larger than 4GB ( unzip doesn't work)

My unzip command doesn't work for files that are greater than 4GB. Consider my file name is unzip -p -a filename.zip, the command doesn't work since the size of the file is larger. I need to know the corresponding 7z command for the same. This is my Unix shell script program:

Code:
 if [ "${FILECOMMANDOUTPUT}" = "ASCII" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "ISO-8859" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "UTF-8" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "Non-ISO" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "data" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "empty" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "Bio-Rad" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "Linux" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "Apple" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "Macintosh" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "English" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "compress'd" ]
then
  COMMANDTOUSE="gunzip -c"
elif [ "${FILECOMMANDOUTPUT}" = "compressed" ]
then
  COMMANDTOUSE="gunzip -c"
elif [ "${FILECOMMANDOUTPUT}" = "gzip" ]
then
  COMMANDTOUSE="gunzip -c"
elif [ "${FILECOMMANDOUTPUT}" = "Zip" ]
then
  COMMANDTOUSE="/usr/bin/unzip -p -a"
elif [ "${FILECOMMANDOUTPUT}" = "Par" ]
then
  COMMANDTOUSE="cat"
elif [ "${FILECOMMANDOUTPUT}" = "Netpbm" ]
then
  COMMANDTOUSE="cat"
else
  echo "${FILECOMMANDOUTPUT} is not known"
  exit 1
fi

I need to change the line COMMANDTOUSE="/usr/bin/unzip -p -a which unzips a zip file. How can I change that?

Last edited by Corona688; 11-04-2014 at 11:02 AM..
# 2  
Old 11-04-2014
Which Operating System are we talking? Unix/Linux or Windoze?
# 3  
Old 11-04-2014
Hi,

Its UNIX environment.

Chandra
# 4  
Old 11-04-2014
Yea, but which Unix????

A common workaround for this problem is to install Java and then you can run:

Code:
jar xf <zip file>

You might also try 'gunzip'
# 5  
Old 11-04-2014
Hi Thanks for your suggestion for your manual workaround . But I need to know the corresponding 7z command (7z is already installed ) .Its an Linux server where we need to read a data from a particular path. The shell script is failing for the zip file larger than 4GB.

Thanks for your help

Chandra
# 6  
Old 11-04-2014
Try this:
Code:
7z e -t zip filename.zip

Source: 7z man page (7z(1) - Linux man page)
# 7  
Old 11-04-2014
Quote:
Originally Posted by chandraprakash
Its an Linux server where we need to read a data from a particular path. The shell script is failing for the zip file larger than 4GB.
Sounds like you have an ancient version of unzip, try updating it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Backingup larger files with TAR command

I need to backup my database but the files are very large and the TAR command will not let me. I searched aids and found that I could do something with the mknod, COMPRESS and TAR command using them together. I appreciate your help. (10 Replies)
Discussion started by: frizcala
10 Replies

2. Shell Programming and Scripting

Ssh remote command doesn't work from script file

I have 10 application servers in a distributed architecture generating their own application logs. Each server has application utility to continuously tail the log. for example following command follows tails and follows new logfiles as they are generated server1$ logutility logtype When I run... (8 Replies)
Discussion started by: indianya
8 Replies

3. Shell Programming and Scripting

Single command - unzip files from a tar command

I have a tar file that contains multiple .Z files. Hence I need to issue a tar command followed by a gzip command to fully extract the files. How do I do it in a single command? What I'm doing now is tar xvf a.tar (this will output 1.Z and 2.Z) gzip -d *.Z (to extract 1.Z and 2.Z) (9 Replies)
Discussion started by: ericlim
9 Replies

4. Solaris

Mount command doesn't work on Solaris System

Hi All, I am using a solaris Sun-Fire-V440 server. The OS is solaris. My problem is whenever I run the command mount | grep "^/ " | sed -e 's,^.*dsk/\(*\).*$,\1,' it should return a disk value as "d30" as it does on each of my other servers.But on this server I am not getting any o/p from... (3 Replies)
Discussion started by: vivek.goel.piet
3 Replies

5. Shell Programming and Scripting

sed command works on Fedora/Ubuntu, but doesn't work in Mac

Hi, I have a question. I define a function using sed command: replace() { searchterm=$1 replaceterm=$2 sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp' mv $WORK'tempfile.tmp' $3 } Then I call replace 'test = 0' 'test = 1' $myfile This code... (1 Reply)
Discussion started by: Dark2Bright
1 Replies

6. Shell Programming and Scripting

sed command works on Fedora/Ubuntu, but doesn't work in Mac

Hi, I have a question. I define a function using sed command: replace() { searchterm=$1 replaceterm=$2 sed -e "s/$searchterm/$replaceterm/ig" $3 > $WORK'tempfile.tmp' mv $WORK'tempfile.tmp' $3 } Then I call replace 'test = 0' 'test = 1' $myfileThis code works well in... (1 Reply)
Discussion started by: Dark2Bright
1 Replies

7. UNIX for Dummies Questions & Answers

find command in shell script doesn't work

Hello all, Something strange going on with a shell script I'm writing. It's trying to write a list of files that it finds in a given directory to another file. But I also have a skip list so matching files that are in that skip list should be, well uhm, skipped :) Here's the code of my... (2 Replies)
Discussion started by: StijnV
2 Replies

8. Shell Programming and Scripting

cd command doesn't work through variables

Hi.... cd command is not working when dual string drive/volume name is passed to cd through variables....... For Ex.... y=/Volumes/Backup\ vipin/ cd $y the above command gives error....... anyone with a genuine solution ? (16 Replies)
Discussion started by: vipinchauhan222
16 Replies

9. Shell Programming and Scripting

Command doesn't work under cron ?

I have defined in cron crontab -l >/FIXENGINE/data/crontab.$(whoami).$(date +%a) The resulting file is named crontab.fixadmin. When I run the above from a command line, the file is named: crontab.fixadmin.Tue (or whatever day I happen to be running) The question is - why do I get... (4 Replies)
Discussion started by: bigjohn-nj
4 Replies

10. Shell Programming and Scripting

command line work script doesn't

Hello, I'm stuck and confused as to why when I execute things form the command line it works but when in a script it doesn't. My script: ### creating a lock on the console touch /var/run/console.lock chmod 600 /var/run/console.lock echo "$User" >>... (2 Replies)
Discussion started by: larry
2 Replies
Login or Register to Ask a Question