Using gzip

Posted on 2005-04-07
Last Modified: 2010-04-20
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


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.

Question by:Simon336697
    LVL 23

    Expert Comment

    gzip -9 < originalfile > targetfile.gz

    [If targetfile.gz  already exists, it will be overwritten]
    LVL 23

    Accepted Solution

    Oh,  -9  just means  'best compression'

    you can do

    gzip  < sourcefile > targetfile.gz


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

    gzip -d < compressedfile.gz > uncompressedfile

    LVL 48

    Assisted Solution

    or simply

    gzip <file >file.gz

    BTW, gz is the standard extension for gzip files, not gzip.
    LVL 12

    Assisted Solution

    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
    LVL 1

    Author Comment

    Thanks guys!!!
    LVL 12

    Expert Comment

    Thank you Simon336697

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
    Join Greg Farro and Ethan Banks from Packet Pushers ( and Greg Ross from Paessler ( for a discussion about smart network …
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now