From f4ee809fc4f49c68d1e323065e6d1c6ef3229fee Mon Sep 17 00:00:00 2001 From: Q Date: Sun, 16 Mar 2025 11:53:54 +0200 Subject: [PATCH] introducing wcd --- q-tools-functions | 9 +++++++++ 1 file changed, 9 insertions(+) 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 {