I wonder how in one command I can switch to another user (in my case it is usually
root) and still remain in the same location where I am before the change.
I usually do it this way, unfortunately taking many steps:
user1@m:~/loc1/loc2$ pwd /home/user1/loc1/loc2 user1@m:~/loc1/loc2$ su - Password: root@m:~# cd /home/user1/loc1/loc2 root@m:/home/user1/loc1/loc2#
I am looking for something like:
user1@m:~/loc1/loc2$ su - && ...
or similar, which will give me this result: