From 84636be8bd95fbc665de65543e5745244f436c1b Mon Sep 17 00:00:00 2001 From: Artem Sapegin Date: Thu, 25 Apr 2013 23:54:10 +0400 Subject: [PATCH] Bash: cd into whatever is the forefront Finder window. --- includes/bash_functions.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/bash_functions.bash b/includes/bash_functions.bash index 16c785e..b277123 100644 --- a/includes/bash_functions.bash +++ b/includes/bash_functions.bash @@ -8,6 +8,11 @@ function md() { mkdir -p "$@" && cd "$@" } +# cd into whatever is the forefront Finder window. +cdf() { + cd "`osascript -e 'tell app "Finder" to POSIX path of (insertion location as alias)'`" +} + # Find shorthand function f() { find . -name "$1" 2>/dev/null