├── README.md └── zip_unzip.ipynb /README.md: -------------------------------------------------------------------------------- 1 | Open In Colab 2 | # Brief 3 | Any file stored on google drive can be zipped/unzipped by a simple jupyter notebook on colab 4 | 5 | You can use wget to download a file from direct link to your drive 6 | -------------------------------------------------------------------------------- /zip_unzip.ipynb: -------------------------------------------------------------------------------- 1 | {"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"name":"zip/unzip.ipynb","provenance":[],"collapsed_sections":[]},"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"}},"cells":[{"cell_type":"markdown","metadata":{"id":"r4bPxFSe8rdt"},"source":["Mount the drive"]},{"cell_type":"code","metadata":{"id":"0et2A6N3udA0","colab":{"base_uri":"https://localhost:8080/"},"executionInfo":{"status":"ok","timestamp":1606316423421,"user_tz":-360,"elapsed":48832,"user":{"displayName":"Devill Don","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjW5uWASj5O2lhgXIicjwIfMEs4P_uEdLEl09YA6w=s64","userId":"01097021810149398508"}},"outputId":"8314b571-b677-4715-aafd-71863b067e69"},"source":["from google.colab import drive\n","drive.mount('/content/gdrive/')"],"execution_count":1,"outputs":[{"output_type":"stream","text":["Mounted at /content/gdrive/\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"Ykp7tS-q8yNu"},"source":["Add the packages for zipping/unzipping operation"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"nc9X9EwhwjrW","executionInfo":{"status":"ok","timestamp":1606316428728,"user_tz":-360,"elapsed":3270,"user":{"displayName":"Devill Don","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjW5uWASj5O2lhgXIicjwIfMEs4P_uEdLEl09YA6w=s64","userId":"01097021810149398508"}},"outputId":"dc2a31c8-8c6a-4551-f8d8-06a00e9e38a2"},"source":["!apt install zip tar unzip"],"execution_count":2,"outputs":[{"output_type":"stream","text":["Reading package lists... Done\n","Building dependency tree \n","Reading state information... Done\n","unzip is already the newest version (6.0-21ubuntu1).\n","zip is already the newest version (3.0-11build1).\n","tar is already the newest version (1.29b-2ubuntu0.1).\n","0 upgraded, 0 newly installed, 0 to remove and 14 not upgraded.\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"ZO9ARPos85yE"},"source":["Check the available directories"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"Rui8-JJZx-Ed","executionInfo":{"status":"ok","timestamp":1606316990527,"user_tz":-360,"elapsed":931,"user":{"displayName":"Devill Don","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjW5uWASj5O2lhgXIicjwIfMEs4P_uEdLEl09YA6w=s64","userId":"01097021810149398508"}},"outputId":"893514f0-69a3-401f-8d3a-593e77e775f1"},"source":["!ls"],"execution_count":6,"outputs":[{"output_type":"stream","text":["gdrive\tsample_data\n"],"name":"stdout"}]},{"cell_type":"markdown","metadata":{"id":"zaSokjMi9VFP"},"source":["Note: here the path \"gdrive/MyDrive/\" is for your own drive\n","and \"gdrive/Shareddrives/{Shared drive's name}/\" is for shared drives"]},{"cell_type":"markdown","metadata":{"id":"xG3lqnvj-pxg"},"source":["use \"unzip\" command for the zip file & use \"tar -xvf\" for the tar file"]},{"cell_type":"markdown","metadata":{"id":"ndQH85Oq_Cww"},"source":["If you wanna create zip archive then use \"zip -r 'anything.zip' 'file' 'folder'\" command to archive single or multiple file or folder"]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"c3R5PVxdwq3W","executionInfo":{"status":"ok","timestamp":1606316832796,"user_tz":-360,"elapsed":175118,"user":{"displayName":"Devill Don","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjW5uWASj5O2lhgXIicjwIfMEs4P_uEdLEl09YA6w=s64","userId":"01097021810149398508"}},"outputId":"af5f55a6-20cf-4407-dbd4-07b616c64930"},"source":["!cd gdrive/Shareddrives/Own/ && zip -r 'Ice Age.zip' 'Ice Age (2002)' 'Ice Age 4 Continental Drift (2012)' 'Ice Age Dawn of the Dinosaurs (2009)' 'Ice Age The Meltdown (2006)' 'Ice.Age.Collision.Course.2016.720p.HDRiP.850MB.ShAaNiG.mkv'"],"execution_count":4,"outputs":[{"output_type":"stream","text":[" adding: Ice Age (2002)/ (stored 0%)\n"," adding: Ice Age (2002)/Ice Age.2002.720p.BrRip.x264.YIFY.srt (deflated 62%)\n"," adding: Ice Age (2002)/WWW.YIFY-TORRENTS.COM.jpg (deflated 1%)\n"," adding: Ice Age (2002)/Other/ (stored 0%)\n"," adding: Ice Age (2002)/Other/Torrent Downloaded From ExtraTorrent.com.txt (deflated 47%)\n"," adding: Ice Age (2002)/Other/Torrent downloaded from Demonoid.com - Copy.txt (stored 0%)\n"," adding: Ice Age (2002)/Other/AhaShare.com.txt (stored 0%)\n"," adding: Ice Age (2002)/Ice Age.2002.720p.BrRip.x264.YIFY.mp4 (deflated 0%)\n"," adding: Ice Age 4 Continental Drift (2012)/ (stored 0%)\n"," adding: Ice Age 4 Continental Drift (2012)/Ice.Age.Continental.Drift.2012.720p.BluRay.x264.YIFY.srt (deflated 62%)\n"," adding: Ice Age 4 Continental Drift (2012)/WWW.YIFY-TORRENTS.COM.jpg (deflated 1%)\n"," adding: Ice Age 4 Continental Drift (2012)/Ice.Age.Continental.Drift.2012.720p.BluRay.x264.YIFY.mp4 (deflated 0%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/ (stored 0%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/Ice Age Dawn of the Dinosaurs.2009.720p.BrRip.x264.YIFY.mp4 (deflated 0%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/WWW.YIFY-TORRENTS.COM.jpg (deflated 1%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/Other/ (stored 0%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/Other/Torrent Downloaded From ExtraTorrent.com.txt (deflated 47%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/Other/Torrent downloaded from Demonoid.com - Copy.txt (stored 0%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/Other/AhaShare.com.txt (stored 0%)\n"," adding: Ice Age Dawn of the Dinosaurs (2009)/Ice Age Dawn of the Dinosaurs.2009.720p.BrRip.x264.YIFY.srt (deflated 61%)\n"," adding: Ice Age The Meltdown (2006)/ (stored 0%)\n"," adding: Ice Age The Meltdown (2006)/Ice Age The Meltdown.2006.720p.BrRip.x264.YIFY.srt (deflated 61%)\n"," adding: Ice Age The Meltdown (2006)/Ice Age The Meltdown.2006.720p.BrRip.x264.YIFY.mp4 (deflated 0%)\n"," adding: Ice Age The Meltdown (2006)/WWW.YIFY-TORRENTS.COM.jpg (deflated 1%)\n"," adding: Ice Age The Meltdown (2006)/Other/ (stored 0%)\n"," adding: Ice Age The Meltdown (2006)/Other/Torrent Downloaded From ExtraTorrent.com.txt (deflated 47%)\n"," adding: Ice Age The Meltdown (2006)/Other/Torrent downloaded from Demonoid.com - Copy.txt (stored 0%)\n"," adding: Ice Age The Meltdown (2006)/Other/AhaShare.com.txt (stored 0%)\n"," adding: Ice.Age.Collision.Course.2016.720p.HDRiP.850MB.ShAaNiG.mkv (deflated 0%)\n"],"name":"stdout"}]},{"cell_type":"code","metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"i2apUs02WSAz","executionInfo":{"status":"ok","timestamp":1606156355449,"user_tz":-360,"elapsed":1687,"user":{"displayName":"Devill Don","photoUrl":"https://lh3.googleusercontent.com/a-/AOh14GjW5uWASj5O2lhgXIicjwIfMEs4P_uEdLEl09YA6w=s64","userId":"01097021810149398508"}},"outputId":"434625a3-3ce5-408c-c44a-e880ed9e4d6e"},"source":["!cd gdrive/MyDrive/ && unzip 'Exam.zip'"],"execution_count":null,"outputs":[{"output_type":"stream","text":["Archive: Exam.zip\n"," creating: Exam/\n"," inflating: Exam/Benifits of inline finishing system.jpg \n"," inflating: Exam/inline finishing production system.jpg \n"," inflating: Exam/purpose of washing.jpg \n"," inflating: Exam/Q=Apparel Production System Analysis.jpg \n"," inflating: Exam/Q=Bangladesh Studies.jpg \n"," inflating: Exam/Q=Bangladesh Studies2.jpg \n"," inflating: Exam/Q=Basic Apparel Washing & Industrial Apperal Washing.jpg \n"," inflating: Exam/Q=finishing room.jpg \n"," inflating: Exam/Q=Principal and practice export import buisness.jpg \n"," inflating: Exam/Q=Sewing Construction & Techniques.png \n"],"name":"stdout"}]}]} 2 | --------------------------------------------------------------------------------