How to Unzip. Gz File Using Google Colab?

I downloaded the English FastText embedding file with the .gz extension. When I intended to unzip it using Google Colab, I get the following error:

Archive:  /content/drive/My Drive/New_ABCDM_Architec/cc.en.300.vec.gz End-of-central-directory signature not found.  Either this file is not a zipfile, or it constitutes one disk of a multi-part archive.  In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /content/drive/My Drive/New_ABCDM_Architec/cc.en.300.vec.gz or /content/drive/My Drive/New_ABCDM_Architec/cc.en.300.vec.gz.zip, and cannot find /content/drive/My Drive/New_ABCDM_Architec/cc.en.300.vec.gz.ZIP, period
\n!unzip  '/content/drive/My Drive/New_ABCDM_Architec/cc.fr.300.vec.gz'\n!unzip  '/content/drive/My Drive/New_ABCDM_Architec/cc.ar.300.vec.gz'\n

I understand that to use !unzip the file should have a .zip extension. My question is, how to unzip .gz files?

2

1 Answer

!tar -xzvf "/content/drive/path/file_name.tar.gz" "/content/drive/path/destination_directory"

 

Flags

  • -x : Extract
  • -c : Create a new archive
  • -v : Verbose output
  • -f : Use the given archive file (name.extention)
  • -z : Filter the archive through gzip
  • -j : Filter the archive through bzip2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest