Reboot computer from terminal command
There are several ways to reboot a computer from the terminal.
For
Linux
or
macOS
the “reboot” command (or shutdown -r) is commonly used.
For Windows, the PowerShell command
Restart-Computer
is a standard way to reboot the system from Terminal.
Within Windows Subsystem for Linux (WSL), the “reboot” command is only for the particular WSL instance and actually results in a shutdown of the WSL instance, not the entire Windows system. One can verify this by before and after the standard 8 second WSL shutdown time, running in Windows Terminal:
wsl.exe --list --running