td aliased to cd $(whatever the command is to get the got root directory)
cd …
sl
choochoo
Wait until we tell them about autojump
alias cd..='cd ..' alias cd...='cd ../..' alias cd....='cd ../../.. alias cd.....='cd ../../../..'
Then forget all that and just use
cd ~
orcd /
No need for
~
- justcd
works as well.
cd .. !! !! !!
In your rc: alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' Usage: 1/2/3 $ ... 1 $
This is the way.
Or just use zsh
Yeah, let’s use whole different shell, because you can’t add some few aliases to your
.bashrc
.That’s not why I use a whole different shell. It just happens to be a perk of the one I use.
That’s pretty neat
.....
for zsh usersExcuse me what? I’ve been multi cd’ing for years like a chump?
Exactly. The fucking what now?
Doesn’t work on my machine… is it a setting that needs to be enabled or something?
git () { if [ "$1" = "cd" ] then shift cd "./$(command git rev-parse --show-cdup)$*" else command git "$@" fi }
.....
i use fish shell with https://github.com/nickeb96/puffer-fish
basically when i type
it expands to
../..
and adds another/..
for every additional dot i typeits similar to what the zsh users in the comment section are doing
I was about to post something similar. With fish you can do your own functions, right? So, you can pass any dots as arguments to a function called
cd
, so, for every extra dot after..
, you append a/..
at the end.
bind '"^H":"cd ..^M"'
z myDir
cd…
I use a lot
cd -
(go to previous) or justcd
to go home.alias .4=cd …/…/…/…
alias -g .4=“…/…/…/…”