When use sudo -i I will simulate login as root, and current working directory will be jumped to /root.
Is it possible not to jump and keep the working directory unchanged?
Do you need to simulate an initial log in, you can use sudo -s to just get a root shell.
sudo -i "cd `/bin/pwd` ; /bin/bash"
Sign up using Google
Sign up using Facebook
Sign up using Stack Exchange
2 years ago
8 months ago