Skip to content

Instantly share code, notes, and snippets.

@omgmog
Created March 2, 2015 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omgmog/e5ec4fce55af2f5d8719 to your computer and use it in GitHub Desktop.
Save omgmog/e5ec4fce55af2f5d8719 to your computer and use it in GitHub Desktop.
Better bash open
#!/bin/bash
# This just wraps the bash `open` command to allow it to open directories using `nautilus`, just as `open` on Mac OS uses Finder.app.
open(){
if [[ -d "${1}" ]]; then
nautilus $1
elif [[ -f "${1}" ]]; then
\open $1
else
echo "Not a valid file or directory."
exit 1
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment