Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compress file without replace original 2

Status
Not open for further replies.

aneesz

Technical User
Nov 12, 2000
17
0
0
MY
Hi everyone, need some help or advice.

How to compress a file without replacing the original file.
Normally compress command will compress a file, renamed with the extension '.Z' and replace the original.

Making a copy to this file and compress the copied one is not what i intend to do b'coz of the space constraint.

TQ in advance
 
"Making a copy to this file and compress the copied one is not what i intend to do b'coz of the space constraint."

But isn't that exactly what you're intending to do if you compress the original but want to keep both it and the compressed copy?
 
Yeah.. its sound like that but the size of the compressed one is 70% reduced.

From what i've known, that's the only way, copy the file to a other given name then compressed it.. but need to find out if there is such other way..

TQ.
 
This should do the trick.

compress -c file > file.Z
 
Thank you, usige (and Aneesz for asking the question)! There have been many times I've had to compress a file for ftp to another box, but I always had to uncompress after the ftp is over.
 
TQ to usige.. :) It solved my problem..

 
Hi,

I like it in this way ....

compress -cfF file > file.Z

-f or -F Forces compression. The -f and -F flags are interchangeable. Overwrites the File.Z file if it already exists.

Best Regrads,
vivek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top