Last Updated: February 25, 2016
·
1.068K
· niedzielski

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 ~

3 Responses
Add your response

OS X support

case "$OSTYPE" in
      cygwin) gui() { explorer "${1:-.}"; } ;;
   linux-gnu) gui() { nautilus "${1:-.}"; } ;;
  darwin11.0) gui() { open "${1:-.}"; } ;;
           *) echo 'Unknown file manager.' >&2 ;;
 esac
over 1 year ago ·

Thanks! Tip updated for OS X.

over 1 year ago ·

I would go with thunar for linux.

over 1 year ago ·