systemd-run Command Examples

Run programs in transient scope units, service units, or path-, socket-, or timer-triggered service units. More information: https://www.freedesktop.org/software/systemd/man/systemd-run.html.

sudo systemd-run {{command}} {{argument1 argument2 ...}}

systemd-run --user {{command}} {{argument1 argument2 ...}}

sudo systemd-run --unit={{name}} --description={{string}} {{command}} {{argument1 argument2 ...}}

sudo systemd-run --remain-after-exit --set-env={{name}}={{value}} {{command}} {{argument1 argument2 ...}}

sudo systemd-run --on-calendar={{calendar_event}} {{command}} {{argument1 argument2 ...}}

systemd-run --remain-after-exit --pty {{command}}

systemd-run --property MemoryMax={{memory_in_bytes}} --property CPUQuota={{percentage_of_CPU_time}}% --wait {{command}}

{{command1}} | systemd-run --pipe {{command2}} | {{command3}}