Magento 2 not working after the command bin/magento setup:di:compile

Permission change after setup:upgrade | Magento 2 | Apache2 | Ubuntu | PHP 7.2

Always use update-upgrade commands the following way –

sudo -u www-data php bin/magento setup:upgrade