Jumping to the Finder location in Terminal

# 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 }

3 Responses

I like this idea, but I'm not sure how to use it. Could you give an example of how to use this? ta, Ben.
You can add it as a function in your .bash_profile
Thanks arnel :)

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.