954,228 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Compress a file to a different filename

Hi

I am trying to compress a file. But I want my original file to be there.
eg. if I have file named file1
then after compressing I should have 2 files:
file1
file1.z

(I googled and tried gzip and zcat but couldn't do it)
Thanks

grvs
Junior Poster in Training
70 posts since Jun 2008
Reputation Points: 27
Solved Threads: 0
 

did you try looking at the man page for gzip?

Moncky
Light Poster
41 posts since Dec 2010
Reputation Points: 11
Solved Threads: 4
 
>>gzip -c file1>>file1.gz
e.g
 >>gzip -c hello.c>>hello.gz
ravi89
Junior Poster
114 posts since Jun 2009
Reputation Points: 11
Solved Threads: 13
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: