run as user linux code example Example: linux execute as user sudo -H -u otheruser bash -c 'echo "I am $USER, with uid $UID"'