I think popd pops off of the directory history stack, rather than the directory hierarchy itself; so if you do this:
$ pushd /tmp
$ pushd
$ pushd projects/
followed by popd; popd, you'll end up in /tmp/ once again. I'm guessing that autopushd aliases cd to pushd to make this more automatic; in zsh cd does that by default.
VP of DevRel RapidAPI ❯ Award-winning Web Developer NodeCLI.com ❯ Google Dev Expert Web tech ❯ 2x GitHub Stars Award ❯ WordPress Core Dev ❯ TEDx Speaker ❯ "awesome example for devs" — Satya Nadella
Location
San Francisco Bay Area
Education
EE-CS Engineer turned Software Developer
Work
VP of DevRel (DX Eng., Content & Community) RapidAPI ❯ Google Dev Expert ❯ GitHub Star ❯ NodeCLI.com
I think
popd
pops off of the directory history stack, rather than the directory hierarchy itself; so if you do this:followed by
popd; popd
, you'll end up in/tmp/
once again. I'm guessing thatautopushd
aliasescd
topushd
to make this more automatic; in zshcd
does that by default.Makes a lot of sense. And I think typing
to go to prev dir is quite easy for me to remember. Wouldn't you agree? 🤔
correct, popd uses the pushd history; it does not use the directory hierarchy. Use
cd ..
for that.