Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

`cd -` to go back to the previous directory. Saved me LOTS of time over the past few months.


And `git checkout -` to checkout the previously checked-out branch.


Wow. Thanks for this. I always cursed myself for forgetting to pushd, and now it turns out I didn't need to!


I recently found out that zsh lets you magically popd as well, as long as you're cding deeper into the tree. If you jump to a different subtree it will pop its internal stack until it finds a parent of the target dir.


pushd and popd are very useful too.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: