I want to unpack 20Gb archive, but I don't have another 20-30Gb of HDD free space. Is it possible to unpack this file over itself ?
So that zip file will be deleted after unpacking and I will have unpacked content.
I want to unpack 20Gb archive, but I don't have another 20-30Gb of HDD free space. Is it possible to unpack this file over itself ?
So that zip file will be deleted after unpacking and I will have unpacked content.
There's no -m
(move) switch for unzip as there is for zip, but you can extract the files from the archive one by one and delete them immediately after extracting them.
I don't know much about OS X, but this works with Bash on Ubuntu:
IFS=$'\n'
for file in `zipinfo -Z1 ZIPFILE`; do
unzip ZIPFILE $file && zip -d ZIPFILE $file
done
rm ZIPFILE
unset IFS
IFS=$'\n'
sets the internal field separator to newline, so filenames that contain spaces will get handled properly.
zipinfo -Z1 ZIPFILE
lists the contents of ZIPFILE, one by line.
for file in `...`; do ??? done
loops through the output of ...
, sets the variable file to one line the output of the command and executes ???
.
unzip ZIPFILE $file && zip -d ZIPFILE $file
extracts the file specified in file from the zipfile and deletes it from the archive (zip -d
).
Here, &&
makes sure the second command gets executed only if the first terminated successfully.
rm ZIPFILE
removes the (empty) archive.
unset IFS
restores the default value of the internal file separator.
&&
in combination with the delete command.
I believe it is not possible. In your case you will need an extra storage media to send the extracted content; or move the zip to it and extract it to your hard drive.