diff --git a/q-tools-functions b/q-tools-functions index 54c52bd..1478553 100644 --- a/q-tools-functions +++ b/q-tools-functions @@ -399,6 +399,15 @@ function scd() { \cd "$cdto" } # scd ends +function wcd() { + # cd to folder that matches "which" dirname + if [[ "$1" = "-h" ]] || [[ -z "$1" ]]; then + echo which-cd. Give executable name to cd to the path of the executable + return + fi + \cd $( dirname $( which "$1" ) ) +} + ## File processing functions function foldermenu_prompt {