How to redirect zip to another folder

28 April,2016 by Jack Vamvas

Question: When attempting to use gzip on Linux and zip the file - I tried by going to another folder and completing the gzip command as normal. As an example:

Move to another folder , the intended target for the zipped file

Execute code as similar

gzip /myfolder/file.txt

 I  discovered it was gzip in the same folder  as the source folder. Not zipping the file in the target folder.

Is it possible to gzip and redirect to another folder?

Answer:  You need to use the  -c switch

So if you need to redirect the zip file to the intended target folder you would execute code similar to the below.

gzip -c filename > /target/location/filename1.Zip

 

Read More

How to generate db2support files (DBA DB2)

Real world experience is the DBA king

 

Author: Jack Vamvas(http://www.dba-db2.com)

Share:

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been saved. Comments are moderated and will not appear until approved by the author. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment on How to redirect zip to another folder

Comments are moderated, and will not appear until the author has approved them.


dba-db2.com | DB2 Performance Tuning | DBA DB2:Everything | FAQ | Contact | Copyright