# Zip / Compress a file that is located on Google Drive

**URL:** <https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857>\
**Category:** Discussion & Solutions\
**Tags:** solved\
**Created:** [April 23, 2020, 7:46pm UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857 "2020-04-23T19:46:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scorpion](https://onehack.st/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@Scorpion](https://onehack.st/u/Scorpion)\
**Post date:** [April 23, 2020, 7:46pm UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857/1 "2020-04-23T19:46:45Z")

</div>

I want to compress some folders In Google Drive. Does anyone know the Python or Google Colab method for file compression in Gdrive?

---

<div class="post-metadata">

**Author:** ![atlonxp](https://onehack.st/user_avatar/onehack.st/atlonxp/32/38549_2.png) [@atlonxp](https://onehack.st/u/atlonxp)\
**Post date:** [April 23, 2020, 7:53pm UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857/2 "2020-04-23T19:53:17Z")

</div>

1. **Section 1** : mount your Google Drive
2. **Section 2** : install zip and unzip commands

```auto
!apt-get update
!apt-get install zip

```

3. **Section 3** :

- zip folder

- zip folder with level 9 encryption

Remember! Google Collab is running in Linux environment, every files and folders that have spaces must have _backslash_ “\” placed before them.

---

<div class="post-metadata">

**Author:** ![Scorpion](https://onehack.st/letter_avatar_proxy/v4/letter/s/6f9a4e/32.png) [@Scorpion](https://onehack.st/u/Scorpion)\
**Post date:** [April 23, 2020, 8:04pm UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857/3 "2020-04-23T20:04:48Z")

</div>

please check eror

 ![Screenshot_1](https://onehack.st/uploads/default/original/3X/2/6/2659e679659e46fa79548b01c028fd6de631deb4.png)

---

<div class="post-metadata">

**Author:** ![atlonxp](https://onehack.st/user_avatar/onehack.st/atlonxp/32/38549_2.png) [@atlonxp](https://onehack.st/u/atlonxp)\
**Post date:** [April 23, 2020, 8:17pm UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857/4 "2020-04-23T20:17:10Z")

</div>

In linux terminal, you must place backslash “\” before every spaces

“/content/My Drive” ==\> “/content/My\ Drive/”

---

<div class="post-metadata">

**Author:** ![freetrial\_dontban](https://onehack.st/user_avatar/onehack.st/freetrial_dontban/32/38196_2.png) [@freetrial\_dontban](https://onehack.st/u/freetrial_dontban)\
**Post date:** [May 25, 2020, 3:23pm UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857/7 "2020-05-25T15:23:39Z")

</div>

Can I unzip something on GD? using a script.

---

<div class="post-metadata">

**Author:** ![atlonxp](https://onehack.st/user_avatar/onehack.st/atlonxp/32/38549_2.png) [@atlonxp](https://onehack.st/u/atlonxp)\
**Post date:** [May 25, 2020, 3:25pm UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857/8 "2020-05-25T15:25:08Z")

</div>

sure, you can `unzip`

search how to use on Google

---

<div class="post-metadata">

**Author:** ![KillerAz1](https://onehack.st/user_avatar/onehack.st/killeraz1/32/18851_2.png) [@KillerAz1](https://onehack.st/u/KillerAz1)\
**Post date:** [April 24, 2020, 12:05am UTC](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857/5 "2020-04-24T00:05:14Z")

</div>

Use this

> **[Google Colab](https://colab.research.google.com/drive/1wvI1SOwvefrOi_2uQbVn1c7sWzxPIdEX#scrollTo=ejMt22nT6QvD)**

[Next page](https://onehack.st/t/zip-compress-a-file-that-is-located-on-google-drive/81857.md?page=2)
