During my multitasking days, sometimes I will be booted off of an SSH session for one reason or another (idle timeouts, etc), while I am working on another task. When I return to the terminal, I will find myself back at localhost, needing to SSH back to the server. Once back at the server, I'm always in my
~ home directory by default and I need to navigate back to the directory I was at last (if I can remember it) in order to continue working.
Is it possible to automatically return to the last directory I was working in when I login?
I was thinking a homebrew solution would be aliasing
cd to change directories but also save that directory into some environment variable, and then changing to that directory in my
But is there any sort of functionality like this already in Linux?