Using gzip

Hi guys,

Is there a way to zip up a file without having that same file touched?

What I mean is, if I do the following:

gzip xxxx.dsk

It makes

xxxx.dsk.gzip

Not a new, second file so you have

xxxx.dsk, and xxxx.dsk.gzip

Id like to be able to have:

xxxx.dsk, and xxxx.dsk.gzip

Thank you.

Simon
LVL 1
Simon336697Asked:
Who is Participating?
 
MysidiaCommented:
Oh,  -9  just means  'best compression'

you can do

gzip  < sourcefile > targetfile.gz

also

similarly, to decompress  without effecting the compressed file...

gzip -d < compressedfile.gz > uncompressedfile

0
 
MysidiaCommented:
gzip -9 < originalfile > targetfile.gz

[If targetfile.gz  already exists, it will be overwritten]
0
 
TintinCommented:
or simply

gzip <file >file.gz

BTW, gz is the standard extension for gzip files, not gzip.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
GinEricCommented:
Yes, and it would be nice if someone told a lot of developers it must be tarred then compressed and end in .tar.gz

and not .tgz
0
 
Simon336697Author Commented:
Thanks guys!!!
0
 
GinEricCommented:
Thank you Simon336697
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.