Search code examples
cygwingit-bashwindows-explorer

open explorer to specific directory from git bash


When I execute this in Git bash windows on windows ten

foo_man@computer MINGW64 /c/www/root/images/
$ explorer /c/www/root/images/

It opens up explorer, but not to the directory c:\www\root\images. How do I open up a specific directory in windows explorer from git bash


Solution

  • you need /cygdrive/c/www/root/images/

    The following works:

    cd /cygdrive/c/www/root/images/
    explorer .
    

    this could be an alias or script

    explorer $(cygpath -w '/cygdrive/c/www/root/images/')
    

    also works. The $( ) syntax uses the output of the command as an option for explorer