View and Override Unit Files with systemctl cat/edit

systemctl cat reveals a service's unit file plus every drop-in override; systemctl edit creates overrides without touching vendor files.

LinuxservicessystemdconfigMedium risk
Run `systemctl cat <service>.service` to view the unit and its overrides, and `sudo systemctl edit <service>` to create an override.

01Command

Command
$ systemctl cat nginx.service

02What it does

The often-missed detail is that drop-in fragments in /etc/systemd/system/<unit>.d/*.conf add to or replace vendor settings, so what's running may differ from the file in /lib/systemd/system. `systemctl edit` opens an editor pre-seeded for an override and runs daemon-reload automatically. To undo all local changes and return to the packaged file, use `sudo systemctl revert <unit>`.

03Risk

RiskMedium risk
Requirementssystemd 218+

04Undo

Undo
$ sudo systemctl revert nginx.service && sudo systemctl daemon-reload

05Sources

  • systemctl(1) - Linux manual page
    Ubuntu Manpages · technical · 2026-09-17
    Evidence: systemctl cat shows the unit file including any drop-ins; systemctl edit creates an override; systemctl revert restores the vendor version.

Last verified: 2026-09-17 · Category: System & Settings

06Related solutions