So I think many people have gone through this issue where you SSH into a machine, cd
to whatever path you need to be at, and then realize you actually want to be root and not your own user. However, when you sudo su -
, you sign in as root and get taken to root
's home directory.
Is there a way to copy the PWD before I run sudo su -
and then cd to it after without typing it again? Something like cd -
that is available across users.