DEV Community

Discussion on: #OneDevMinute: Go back to the Previous Directory

Collapse
mrahmadawais profile image
Ahmad Awais ⚡️ Author

Yes, you can. It doesn't work everywhere for everyone. So, I prefer:

# Reload the shell (i.e. invoke as a login shell)
alias reload="exec $SHELL -l"

Going to be my next tip.

Collapse
maqbool profile image
Maqbool

It works but it creates a new instance of the shell process.

Thread Thread
mrahmadawais profile image
Ahmad Awais ⚡️ Author

Yes, that's the point. source method doesn't always work for every OS. Not everyone has Zsh, Bash, — folks have many different and custom setups. 🙌