Windows PowerShell Restart-Service equivalent in Linux
Stops and starts a systemd service so configuration or runtime state is reloaded.
PowerShell Restart-Service
sudo systemctl restart SERVICE
sudo systemctl restart SERVICE
sudo systemctl restart SERVICE
Overview
What this command does
On Windows, "PowerShell Restart-Service" is used to restart a service. On Linux, the closest practical mapping shown here is "sudo systemctl restart SERVICE". Stops and starts a systemd service so configuration or runtime state is reloaded. This reference is grouped under PowerShell Equivalents → Services.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows PowerShell Restart-Service maps to sudo systemctl restart SERVICE for this task. Treat this as a workflow mapping rather than a character-for-character syntax translation.
Portable across the compared distros
The Debian/Ubuntu, Fedora and Arch rows use the same command in this mapping. Package availability or defaults can still vary, so check the installed tool version when an option behaves differently.
Elevated privilege appears in this workflow
At least one example uses sudo. Confirm the target path, device, service or package before running the elevated form; do not add sudo simply to bypass an unexplained permission error.
For the broader concept behind this mapping, read PowerShell vs Bash.
Practical tasks
Common use cases
Restart a service
Stops and starts a systemd service so configuration or runtime state is reloaded.
sudo systemctl restart nginx
Restart a service
sudo systemctl reload nginx
Reload configuration when supported
sudo systemctl reload-or-restart nginx
Reload or fall back to restart
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
sudo systemctl restart nginx
sudo systemctl reload nginx
sudo systemctl reload-or-restart nginx
Walkthrough
Examples with explanations
sudo systemctl restart nginx # restart a service
sudo systemctl reload nginx # reload configuration
sudo systemctl reload-or-restart nginx # choose reload when possible
Reference
Common options and variations
| Command or option | Use |
|---|---|
sudo systemctl restart nginx | Restart a service |
sudo systemctl reload nginx | Reload configuration when supported |
sudo systemctl reload-or-restart nginx | Reload or fall back to restart |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
The command "sudo systemctl restart SERVICE" is the same in all three rows, while package or base details differ: Debian/Ubuntu uses apt + systemd; Fedora uses dnf + systemd; Arch uses pacman + systemd.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | apt + systemd | sudo systemctl restart SERVICE |
Same systemctl/journalctl syntax on systemd-based Debian and Ubuntu systems. |
| Fedora | dnf + systemd | sudo systemctl restart SERVICE |
Same command syntax; service names can differ by package. |
| Arch | pacman + systemd | sudo systemctl restart SERVICE |
Same command syntax; enable services explicitly after package installation. |
Keep learning