Skip to content

Instantly share code, notes, and snippets.

@beakr
Last active December 7, 2021 23:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save beakr/10424899 to your computer and use it in GitHub Desktop.
Save beakr/10424899 to your computer and use it in GitHub Desktop.
Open Windows file explorer on a directory with Cygwin.
#!/bin/bash.exe
# This script opens a given directory up in the Windows file explorer. I did
# this to make it easy when opening directories in the Cygwin system using
# the explorer.
#
# To install:
#
# $ touch /usr/bin/opene
# $ vim /usr/bin/opene
# Copy contents of this script to /usr/bin/opene...
# $ chmod +x /usr/bin/opene
#
# Now test it out!
#
# $ opene .
#
# NOTE: credit for the full command goes to this message on the Cygwin mailing
# list: http://cygwin.com/ml/cygwin/2002-09/msg00631.html
/cygdrive/c/Windows/explorer.exe /e,`cygpath -w "$1"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment