Operating System - HP-UX
1834191 Members
2415 Online
110064 Solutions
New Discussion

How to cp and gzip at the same time ?

 
ITSD-ACCS
Frequent Advisor

How to cp and gzip at the same time ?

How to gzip the file during cp in a single command ?
2 REPLIES 2
Mark Grant
Honored Contributor

Re: How to cp and gzip at the same time ?

Several ways to do this all of them nto really saving any time than if you do it in two operations.

The simplest would be

"cp file file.new && gzip file.new"

Never preceed any demonstration with anything more predictive than "watch this"
Victor Fridyev
Honored Contributor

Re: How to cp and gzip at the same time ?

Try this:

gzip -c file > file.gz
Entities are not to be multiplied beyond necessity - RTFM