I need to run two or more commands as another user in Linux. For example, using "root", I need to sudo to another user and do something like "cd /tmp/; ls -ltr".
If I do: "sudo -i -u john.smith whoami" without the double quotes, it will tell me I am john.smith.
Now I want to expand that do whoami, change directories, and execute an ls command while using "root" to sudo as john.smith.