title: How to unzip a file in a specific folder in colaboratory environment after download it?
body: <p>I've looking for a solution to solve the slow upload speed of images dataset on google colab when i use a connection from GoogleDrive. Using the follow code:</p>
  
  <pre><code>from google.colab import drive
  
  drive.mount('/content/gdrive')
  </code></pre>
  
  <p>Using this procedure i can upload images and create labels using a my <code>def load_dataset</code>:</p>
  
  <p><code>'train_path=content/gdrive/MyDrive/Capstone/Enviroment/cell_images/train'</code> </p>
  
  <p><code>train_files, train_targets = load_dataset(train_path)</code></p>
  
  <p>But, as i said, it's very slow, especially because my full dataset is composed by 27560 images.</p>
  
  <p>To solve my problem, i've tried to use <a href="https://medium.freecodecamp.org/how-to-transfer-large-files-to-google-colab-and-remote-jupyter-notebooks-26ca252892fa" rel="noreferrer">this solution</a>.</p>
  
  <p>But now, in order to still use my <code>def</code>function, after download the <code>.tar</code> file i wanna extract in a specific folder in the colab enviroment. I found <a href="https://stackoverflow.com/questions/49685924/extract-google-drive-zip-from-google-colab-notebook">this answer</a> but not solve my problem. </p>
  
  <p>Example:</p>
  
  <p>This is the environment with the test.tar already downloaded.
  <a href="https://i.stack.imgur.com/lYtHk.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lYtHk.png" alt="enter image description here"></a></p>
  
  <p>But i wanna extract the files in the tar file, which structure is <code>train/Uninfected</code> ; <code>train/Parasitized</code>, to get this:</p>
  
  <ul>
  <li><p>content</p>
  
  <ul>
  <li>cell_images
  
  <ul>
  <li>test
  
  <ul>
  <li>Parasitized</li>
  <li>Uninfected</li>
  </ul></li>
  <li>train
  
  <ul>
  <li>Parasitized</li>
  <li>Uninfected</li>
  </ul></li>
  <li>valid
  
  <ul>
  <li>Parasitized</li>
  <li>Uninfected</li>
  </ul></li>
  </ul></li>
  </ul></li>
  </ul>
  
  <p>To use the path in def function:</p>
  
  <p><code>train_path = train_path=content/cell_images/train/'</code> </p>
  
  <p><code>train_files, train_targets = load_dataset(train_path)</code></p>
  
  <p><code>test_path = train_path=content/cell_images/test/'</code> </p>
  
  <p><code>test_files, test_targets = load_dataset(test_path)</code></p>
  
  <p><code>valid_path = train_path=content/cell_images/valid/'</code> </p>
  
  <p><code>valid_files, valid_targets = load_dataset(valid_path)</code></p>
  
  <p>I tried to use:
  <code>! mkdir -p content/cell_images</code>
  and 
  <code>!tar -xvf 'test.tar' content/cell_images</code></p>
  
  <p>But it doesn't work. </p>
  
  <p>Does anyone know how to proceed? </p>
  
  <p>Thanks!</p>