I would like to on ssh login, change directory to my previous one. (I'm the only user on my machine).
This is what I did.
# in .bash_logout
pwd > ~/.last_dir
# in .bashrc
cd "$(cat ~/.last_dir)"
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityI would like to on ssh login, change directory to my previous one. (I'm the only user on my machine).
This is what I did.
# in .bash_logout
pwd > ~/.last_dir
# in .bashrc
cd "$(cat ~/.last_dir)"