LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   unzip and keep original file ? (https://www.linuxquestions.org/questions/linux-newbie-8/unzip-and-keep-original-file-365008/)

Blaumieser 09-19-2005 05:02 PM

unzip and keep original file ?
 
Hi all,
this problem seems very small but I cannot find a solution: When using unzip on an regular zip-file the contents are extracted and the original zip file is gone. I want to extract and keep the original file. How can this be done besides always making a copy with another name or in another place? There seems to be no option mentioned in the corresponding man page...

Thanks in advance
BM

Komakino 09-19-2005 05:09 PM

unzip does keep the original zipfile, unless you're using gzip? But then that doesn't handle multiple files to compress (hence it's used with tar).

Blaumieser 09-20-2005 05:02 PM

Oh, didn't know that. Yes, I used gzip but I thought zip behaved like gzip. I will investigate further if there is an option to tar xzf that keeps the original...

Thanks!
BM

Tinkster 09-20-2005 05:29 PM

tars z option also won't delete the tarball. The only real concern is
with using gunzip on a .gz file. And that can be fixed by using
gunzip -c blurb.gz > blurb


Cheers,
Tink

Blaumieser 09-21-2005 02:56 PM

... cool! That's a nice trick.

Thanks again!
BM

Tinkster 09-21-2005 03:24 PM

Heh - it's not really a trick, it automatically follows from
reading the man-page ;}


Cheers,
Tink


All times are GMT -5. The time now is 07:35 AM.