I often find myself in the situation where the directory structure is like:
a/b/c/d/f/g/...
and I am at a
as pwd
and wish to quickly navigate to f
or g
.
Is it possible to search and move to the particular directory from a
as my pwd
?
I often find myself in the situation where the directory structure is like:
a/b/c/d/f/g/...
and I am at a
as pwd
and wish to quickly navigate to f
or g
.
Is it possible to search and move to the particular directory from a
as my pwd
?
zsh
. – yask Aug 08 '15 at 21:44zsh
fastest is to use double star glob:cd **/g
(assuming there is only one subdirectoryg
). Inbash
you need toshopt -s globstar
first. – jimmij Aug 08 '15 at 21:57**/
? :) – yask Aug 08 '15 at 21:59