Windows sc create / sc delete equivalent in Linux
Defines a new system service by creating a unit file, then enables and starts it.
sc create / sc delete
systemd unit files in /etc/systemd/system/
systemd unit files in /etc/systemd/system/
systemd unit files in /etc/systemd/system/
Overview
What this command does
On Windows, "sc create / sc delete" is used to create a custom systemd service. On Linux, the closest practical mapping shown here is "systemd unit files in /etc/systemd/system/". Defines a new system service by creating a unit file, then enables and starts it. This reference is grouped under Services & Processes → Services.
Windows → Linux context
What changes when you use this on Linux?
Equivalent task, different tool
Windows sc create / sc delete maps to systemd unit files in /etc/systemd/system/ 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.
For the broader concept behind this mapping, read Linux services and processes.
Practical tasks
Common use cases
Create a custom systemd service
Defines a new system service by creating a unit file, then enables and starts it.
/etc/systemd/system/
Location for custom service files
systemctl daemon-reload
Reload after creating/editing unit files
systemctl enable --now myapp
Enable and start immediately
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
sudo nano /etc/systemd/system/myapp.service
sudo systemctl daemon-reload
sudo systemctl enable --now myapp
Walkthrough
Examples with explanations
# Windows: sc create MySvc binpath= C:\app.exe
# Create unit file:
sudo nano /etc/systemd/system/myapp.service
[Unit]
Description=My Application
After=network.target
[Service]
ExecStart=/usr/bin/myapp
Restart=always
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now myapp
Reference
Common options and variations
| Command or option | Use |
|---|---|
/etc/systemd/system/ | Location for custom service files |
systemctl daemon-reload | Reload after creating/editing unit files |
systemctl enable --now myapp | Enable and start immediately |
systemctl cat myapp | View a service's unit file content |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
The command "systemd unit files in /etc/systemd/system/" 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 | systemd unit files in /etc/systemd/system/ |
Same systemctl/journalctl syntax on systemd-based Debian and Ubuntu systems. |
| Fedora | dnf + systemd | systemd unit files in /etc/systemd/system/ |
Same command syntax; service names can differ by package. |
| Arch | pacman + systemd | systemd unit files in /etc/systemd/system/ |
Same command syntax; enable services explicitly after package installation. |
Keep learning