4 ms·
In bash, you can just cd - to pop back to the previous working directory, like popd without the pushd. I also set .bash_profile aliases to quickly cd up the di
by cpeterso 14y ago
In bash, you can just cd - to pop back to the previous working directory, like popd without the pushd.
I also set .bash_profile aliases to quickly cd up the directory tree with just dots. It's silly, but surprising helpful.
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
- zaptheimpaler 14y agoI like that idea, I could definitely see it being helpful. I've type cd.. too many times when I meant to say cd ..
- cpeterso 14y agome too. That's why I also: alias cd..='cd ..' :)
- chanux 14y agoI did some Googling and was not satisfied with any of the solutions (pushd/popd, aliases, CDPATH etc.). That's why I wrote this. Works fine for me :) PS: The whole story on my blog https://chanux.wordpress.com/2012/08/09/no-more-cd-dot-dot-slash https://chanux.wordpress.com/2012/08/09/no-more-cd-dot-dot-s...
- klibertp 14y agoAt least '..' is defined by default in zsh.