Skip to content

Instantly share code, notes, and snippets.

@jostyee
Created May 4, 2016 05:12
Show Gist options
  • Save jostyee/609d2c3aa832533c608d560d5074889f to your computer and use it in GitHub Desktop.
Save jostyee/609d2c3aa832533c608d560d5074889f to your computer and use it in GitHub Desktop.
function cdf() # cd to Finder's front window's path
{
path="`osascript -e 'tell application "Finder" to set myname to POSIX path of (target of window 1 as alias)' 2>/dev/null`"
if [ -n "$path" ]; then
echo "cd to $path"
cd "$path"
else
echo "no Finder window found"
fi
}
function fcd() # open current terminal path in Finder
{
open -a Finder ./
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment