systemd-run - run a command in a transient unit or scope
systemd-run [--scope] [--unit=NAME] [-p PROPERTY=VALUE] [--wait] COMMAND
Options you will use
--scope- Run in a scope in the caller's context instead of forking a service.
-p PROPERTY=VALUE- Set a unit property: MemoryMax=200M, CPUQuota=20%.
--unit=NAME- Name the transient unit.
--wait- Wait for the unit to finish and report its result.
Examples
$ sudo systemd-run --scope -p MemoryMax=200M memhog 400Mcgroup-limited run: it gets Killed and $? is 137
Taught in
Try systemd-run in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.