Zip generated files in Colab

How could I zip some files that I generated in google colab?

I have a bunch of PDF files that I generated with my code. I want them to be ziped in one file in order to download that zip file containing everything. There could be hundred of files generated and that is why I do not want to download them one at a time.

Thanks

PD: I don't want to upload those files to my Drive so the solution !zip -r '/content/folder/"NewFileName.zip"' '/content/folder/"OrginalFileName"' is not valid for me

Upvotes: 0

Views: 984

Answers (1)

Andrew Chisholm
Andrew Chisholm

Reputation: 6567

Does this work?

!touch a.pdf
!touch b.pdf
!touch c.pdf
!zip all.zip *.pdf

enter image description here

Obviously change the zip command to point to your files in Colab.

Upvotes: 1

Related Questions