Run Command as Another User in Linux Using sudo -u
How do I run a single command as the mysql user? Try: sudo -u mysql -H bash -c 'echo $HOME && mysql -e "SHOW DATABASES"' Info: Runs commands as another user with an updated HOME environment variable. Examples: $ sudo -u www-data php -r 'echo getcwd();' # Run a snippet […]
Read More