Created
February 16, 2016 04:08
-
-
Save JeremyIglehart/988f90f6d557f2d59136 to your computer and use it in GitHub Desktop.
cdf command
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
# Add the below lines to your .profile | |
# cd to the path of the front Finder window | |
cdf() { | |
target=`osascript -e 'tell application "Finder" to if (count of Finder windows) > 0 then get POSIX path of (target of front Finder window as text)'` | |
if [ "$target" != "" ]; then | |
cd "$target"; pwd | |
else | |
echo 'No Finder window found' >&2 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment