home
• blogs
• about
2023-12-14 02:03AM
#bash #unix #terminal
Sometimes i got in situations where i want to execute a specific command or multiple commands inside a given directory without moving there as quickly as i can !This may sound obvious to just jump there, do the stuff and come back but as a lazy guy, i like doing that as quickly as possible and hit enter once !
So in this tip, you will need zoxide, a nice tool that cache all your paths by their finals dirname, that mean wherever you are in your linux system ~/zig/zag/toum/yyyy
, you just have to type cd xxxx (which is here ~/boum/bam/xxx
), to go there !
So this is my tip:
$1
as the given dir){$@:2}
as all strings after the dir)cd -
)Then add it inside your ~/.bash_aliases
and you're good to go !
You can copy the source code from here !