The zip command generally places the output zip file in the current directory. But, I'm wondering if there is an option that I'm overlooking in the man page that lets me 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 be able to place 'my_archive' under ./my_backups without having to 'cd' into that backups directory. Is there something like:
zip -rt my_archive dir_to_be_archived --destination ./my_backups
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 that you are zipping up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With