How do I download multiple files or an entire folder from Google Colab? How do I download multiple files or an entire folder from Google Colab? python-3.x python-3.x

How do I download multiple files or an entire folder from Google Colab?


I have created a zip file:

!zip -r /content/file.zip /content/Folder_To_Zip

Than I have downloded that zip file:

from google.colab import filesfiles.download("/content/file.zip")


I found that:

!zip -r ./myresultingzippedfolderwithallthefiles.zip ./myoriginalfolderwithallthefiles/

worked for me in colab.

Here . can be your home directory or the directory where your original myoriginalfolderwithallthefiles is and where myresultingzippedfolderwithallthefiles.zip will be created. Change the directories as needed.


For example, if you have to download log folder:

!zip -r log.zip log/

-r represent recursive

while log.zip is destination zip file andlog/ is source folder path

enter image description here