To shut down your Linux machine using the command line or terminal, type:
You will probably need to be the root user or use the sudo command:
You might be wondering what the “-h” is for here. It is a flag for the shutdown command telling it to halt or power off after shutdown. This will ensure that your machine turns completely off.
You can also reboot your machine from the command line.