How to create a zip file using shell script?

From your question, I understand that you want to zip the files in the “Results” directory without considering the directory “Results” itself when trying to zip.

If so, then use the below commands

#!/bin/bash
cd /home/admin/1/2/3/Results
zip -r /home/admin/download.zip ./*

After this, the zip file would be created in the required location. Zip file is with only the files from the result directory, without the “Result” directory itself.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)