popd is different. I'm sorry if it wasn't clear that I meant "this is a similar, but different tool". I did not mean for it to be "that's bad do this instead."
cd .. goes up a directory in the hierarchy. popd goes back in the pushd history.
If you're going "down" in folders, then yes they would happen to do the same thing. But if you're moving across folders, they'll do different things.
Here's a comparison (pretend autopushd is on):
cd /usr/bin
cd /tmp/logs
cd .. # will take you to /tmp
cd .. # will take you to /
cd /usr/bin
cd /tmp/logs
popd # will take you to /usr/bin
popd # will take you to where you were before the first command
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
popd is different. I'm sorry if it wasn't clear that I meant "this is a similar, but different tool". I did not mean for it to be "that's bad do this instead."
cd ..
goes up a directory in the hierarchy.popd
goes back in the pushd history.If you're going "down" in folders, then yes they would happen to do the same thing. But if you're moving across folders, they'll do different things.
Here's a comparison (pretend autopushd is on):
Yes, that makes a lot of sense. Thanks for sharing! 👌