Skip to content

Instantly share code, notes, and snippets.

@niedzielski
Last active December 26, 2017 20:07
Show Gist options
  • Select an option

  • Save niedzielski/ad2ac592bc9a83b7e33079a8f5a81ba6 to your computer and use it in GitHub Desktop.

Select an option

Save niedzielski/ad2ac592bc9a83b7e33079a8f5a81ba6 to your computer and use it in GitHub Desktop.
Open the file manager GUI from the command line.
# Open a file browser GUI in any directory. Add the following to your
# .bashrc:
case "$OSTYPE" in
cygwin) gui() { explorer "${1:-.}"; } ;;
linux-gnu) gui() { nautilus "${1:-.}"; } ;;
darwin*) gui() { open "${1:-.}"; } ;;
*) echo 'Unknown file manager.' >&2 ;;
esac
# Examples
# Open the present working directory.
# $ gui
# Open the home directory.
# $ gui ~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment