fpath: cd into finder
fpath promotes Terminal-Finder interaction by providing easy access to the full paths
leading to the topmost Finder window, and to all open Finder windows. It can best be used
in combination with .profile lines similar to the following:
- cdf: opens a finder window in the current directory
- alias cdf='open .' # no point in invoking osascript for functions provided by the OS
- fcd: changes working directory to the top Finder window
- function fcd () { d=$(fpath -q); if [[ ! $? ]]; then cd "${d}"; else echo "Nowhere to go..." >&2 ; fi; }
fpath | Download Source | View Source