1 | initial version |
from google.colab import drive
drive.mount('/content/drive')
%cd '/content/drive/MyDrive/<directory>'
Replace <directory>
with the path to the directory containing the folder you want to transfer.
!zip -r <foldername>.zip <foldername>
Replace <foldername>
with the name of the folder you want to transfer.
!cp <foldername>.zip '/content/drive/MyDrive/<destination>'
Replace <foldername>
with the name of the zip file you just created and <destination>
with the path to the directory in Google Drive where you want to save the zip file.
!unzip '/content/drive/MyDrive/<destination>/<foldername>.zip' -d '/content/drive/MyDrive/<destination>/<foldername>'
Replace <destination>
and <foldername>
with the appropriate names and paths. This will extract the contents of the <foldername>.zip
file into a new folder with the same name as the original folder.