Created
March 2, 2015 12:01
-
-
Save omgmog/e5ec4fce55af2f5d8719 to your computer and use it in GitHub Desktop.
Better bash open
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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