Last active
March 21, 2017 13:29
-
-
Save webevt/f3099f68bfb24676cce0b0ba245bc011 to your computer and use it in GitHub Desktop.
Save & Restore the Latest Working Dir in Bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put in the end of your ~/.profile or ~/.bashrc | |
PROMPT_COMMAND='printf %s "$PWD" > ~/.lastpwd' | |
[ -s ~/.lastpwd ] && cd "$(<~/.lastpwd)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment