shutdown
command gives you an error:shutdown
command can be run only by the root user or by an administrator user with root user privileges.sudo
command. sudo
stands for superuser do.% sudo shutdown
sudo
. If you’re not logged in as an administrator, you can do so by entering the following command, where adminUsername is the name of an administrator user:su
to switch to the root user. Under normal circumstances, you shouldn’t log in as the root user.su
to log in as the root user, be especially careful, because you have sufficient privileges to make changes that can cause your computer to stop working.