mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-03-22 13:02:32 +00:00
Update cheatsheets
This commit is contained in:
@@ -18,11 +18,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Start a transient service with a custom unit name and description:
|
||||
|
||||
`sudo systemd-run --unit={{name}} --description={{string}} {{command}} {{argument1 argument2 ...}}`
|
||||
`sudo systemd-run {{[-u|--unit]}} {{name}} --description {{string}} {{command}} {{argument1 argument2 ...}}`
|
||||
|
||||
- Start a transient service that does not get cleaned up after it terminates with a custom environment variable:
|
||||
|
||||
`sudo systemd-run --remain-after-exit --set-env={{name}}={{value}} {{command}} {{argument1 argument2 ...}}`
|
||||
`sudo systemd-run {{[-r|--remain-after-exit]}} --set-env={{name}}={{value}} {{command}} {{argument1 argument2 ...}}`
|
||||
|
||||
- Start a transient timer that periodically runs its transient service (see `man systemd.time` for calendar event format):
|
||||
|
||||
@@ -30,12 +30,12 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Share the terminal with the program (allowing interactive input/output) and make sure the execution details remain after the program exits:
|
||||
|
||||
`systemd-run --remain-after-exit --pty {{command}}`
|
||||
`systemd-run {{[-r|--remain-after-exit]}} --pty {{command}}`
|
||||
|
||||
- Set properties (e.g. CPUQuota, MemoryMax) of the process and wait until it exits:
|
||||
|
||||
`systemd-run --property MemoryMax={{memory_in_bytes}} --property CPUQuota={{percentage_of_CPU_time}}% --wait {{command}}`
|
||||
`systemd-run {{[-p|--property]}} MemoryMax={{memory_in_bytes}} {{[-p|--property]}} CPUQuota={{percentage_of_CPU_time}}% --wait {{command}}`
|
||||
|
||||
- Use the program in a shell pipeline:
|
||||
|
||||
`{{command1}} | systemd-run --pipe {{command2}} | {{command3}}`
|
||||
`{{command1}} | systemd-run {{[-P|--pipe]}} {{command2}} | {{command3}}`
|
||||
|
||||
Reference in New Issue
Block a user