Specify the destination directory for the output of the zip command (created Zip file)

The zip command usually places the output zip file in the current directory. But, I am wondering if there is an option that I miss on the manual page that allows me to specify the destination directory for the output archive file.

This created "my_archive" in the current directory:

zip -rT my_archive dir_to_be_archived 

But I want to place "my_archive" under. / my _backups without having "cd" in this backup directory. There is something like:

 zip -rt my_archive dir_to_be_archived --destination ./my_backups 
+7
source share
1 answer

You can specify the destination path directly:

 zip -r /path/to/destination.zip /files 

Keep in mind that the destination should not be in the same directory as the files you are pinching.

+14
source

All Articles