How to unzip a file using git bash (Windows)?

23,485

Install the latest git (git-bash) from https://git-scm.com/downloads - at the time of writing it is the 2.10.0 version. It comes with unzip packaged inside as one of the tools. Check optional unix tools during setup if you already use gitbash as your go-to console.

Share:
23,485
claudios
Author by

claudios

I do things for the web.

Updated on August 06, 2021

Comments

  • claudios
    claudios over 2 years

    Is there a piece of code to unzip a file using git bash on windows? I tried unzipping with this line of code:

    unzip somefile.zip
    

    and it returns a

    bash: unzip: command not found
    
  • negas
    negas almost 4 years
    sudo in windows?
  • Stefan
    Stefan almost 4 years
    Yes, Windows has a linux subsystem. In fact it supports multiple simultaneous subsystems. See here: docs.microsoft.com/en-us/windows/wsl/install-win10
  • Gino Mempin
    Gino Mempin over 3 years
    This was also mentioned in this other answer, where it said unzip is available as of 2.10.
  • joanis
    joanis over 2 years
    As far as I know, this only works for opening gzip'd archves, like .tar.gz or .tgz, but not for zip files.
  • LinuxDisciple
    LinuxDisciple over 2 years
    The question specifically says Git Bash. WSL is off-topic.
  • Stefan
    Stefan over 2 years
    @LinuxDisciple How so? I use Git in WSL Bash all the time, as do many people.
  • LinuxDisciple
    LinuxDisciple over 2 years
    git-bash (see OP's tag) is a Windows program that emulates the Bash terminal. It's a completely different environment from WSL.