1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-01 18:55:24 +02:00

systemd*: add option placeholders and remove = (#16448)

This commit is contained in:
Managor 2025-05-11 14:00:42 +03:00 committed by GitHub
parent 8a7c8de8f6
commit d949bcabb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 47 additions and 47 deletions

View file

@ -9,4 +9,4 @@
- Additionally print `yes` or `no` to `stdout`:
`systemd-ac-power --verbose`
`systemd-ac-power {{[-v|--verbose]}}`

View file

@ -13,4 +13,4 @@
- Display the control group hierarchy of one or more systemd units:
`systemd-cgls --unit {{unit1 unit2 ...}}`
`systemd-cgls {{[-u|--unit]}} {{unit1 unit2 ...}}`

View file

@ -10,11 +10,11 @@
- Change the sort order:
`systemd-cgtop --order={{cpu|memory|path|tasks|io}}`
`systemd-cgtop {{[-i|--order]}} {{cpu|memory|path|tasks|io}}`
- Show the CPU usage by time instead of percentage:
`systemd-cgtop --cpu=percentage`
`systemd-cgtop --cpu percentage`
- Change the update interval in seconds (or one of these time units: `ms`, `us`, `min`):

View file

@ -5,7 +5,7 @@
- Encrypt a file and set a specific name:
`systemd-creds encrypt --name={{name}} {{path/to/input_file}} {{path/to/output}}`
`systemd-creds encrypt --name {{name}} {{path/to/input_file}} {{path/to/output}}`
- Decrypt the file again:
@ -13,12 +13,12 @@
- Encrypt text from `stdin`:
`echo -n {{text}} | systemd-creds encrypt --name={{name}} - {{path/to/output}}`
`echo -n {{text}} | systemd-creds encrypt --name {{name}} - {{path/to/output}}`
- Encrypt the text and append it to the service file (the credentials will be available in `$CREDENTIALS_DIRECTORY`):
`echo -n {{text}} | systemd-creds encrypt --name={{name}} --pretty - - >> {{service}}`
`echo -n {{text}} | systemd-creds encrypt --name {{name}} --pretty - - >> {{service}}`
- Create a credential that is only valid until the given timestamp:
`systemd-creds encrypt --not-after="{{timestamp}}" {{path/to/input_file}} {{path/to/output_file}}`
`systemd-creds encrypt --not-after "{{timestamp}}" {{path/to/input_file}} {{path/to/output_file}}`

View file

@ -9,7 +9,7 @@
- Show only files of specific types (comma-separated list):
`systemd-delta --type {{masked|equivalent|redirected|overridden|extended|unchanged}}`
`systemd-delta {{[-t|--type]}} {{masked|equivalent|redirected|overridden|extended|unchanged}}`
- Show only files whose path starts with the specified prefix (Note: A prefix is a directory containing subdirectories with systemd configuration files):

View file

@ -13,12 +13,12 @@
- Silently check without printing anything:
`systemd-detect-virt --quiet`
`systemd-detect-virt {{[-q|--quiet]}}`
- Only detect container virtualization:
`systemd-detect-virt --container`
`systemd-detect-virt {{[-c|--container]}}`
- Only detect hardware virtualization:
`systemd-detect-virt --vm`
`systemd-detect-virt {{[-v|--vm]}}`

View file

@ -9,15 +9,15 @@
- Mount an OS image:
`systemd-dissect --mount {{path/to/image.raw}} {{/mnt/image}}`
`systemd-dissect {{[-m|--mount]}} {{path/to/image.raw}} {{/mnt/image}}`
- Unmount an OS image:
`systemd-dissect --umount {{/mnt/image}}`
`systemd-dissect {{[-u|--umount]}} {{/mnt/image}}`
- List files in an image:
`systemd-dissect --list {{path/to/image.raw}}`
`systemd-dissect {{[-l|--list]}} {{path/to/image.raw}}`
- Attach an OS image to an automatically allocated loopback block device and print its path:

View file

@ -9,11 +9,11 @@
- Reverse the escaping process:
`systemd-escape --unescape {{text}}`
`systemd-escape {{[-u|--unescape]}} {{text}}`
- Treat the given text as a path:
`systemd-escape --path {{text}}`
`systemd-escape {{[-p|--path]}} {{text}}`
- Append the given suffix to the escaped text:

View file

@ -5,23 +5,23 @@
- Operate on the specified directory instead of the root directory of the host system:
`sudo systemd-firstboot --root={{path/to/root_directory}}`
`sudo systemd-firstboot --root {{path/to/root_directory}}`
- Set the system keyboard layout:
`sudo systemd-firstboot --keymap={{keymap}}`
`sudo systemd-firstboot --keymap {{keymap}}`
- Set the system hostname:
`sudo systemd-firstboot --hostname={{hostname}}`
`sudo systemd-firstboot --hostname {{hostname}}`
- Set the root user's password:
`sudo systemd-firstboot --root-password={{password}}`
`sudo systemd-firstboot --root-password {{password}}`
- Prompt the user interactively for a specific basic setting:
`sudo systemd-firstboot --prompt={{setting}}`
`sudo systemd-firstboot --prompt {{setting}}`
- Force writing configuration even if the relevant files already exist:

View file

@ -13,7 +13,7 @@
- Update the binary hardware database, returning a non-zero exit value on any parsing error:
`systemd-hwdb --strict update`
`systemd-hwdb {{[-s|--strict]}} update`
- Update the binary hardware database in `/usr/lib/udev`:
@ -21,4 +21,4 @@
- Update the binary hardware database in the specified root path:
`systemd-hwdb --root={{path/to/root}} update`
`systemd-hwdb {{[-r|--root]}} {{path/to/root}} update`

View file

@ -21,4 +21,4 @@
- Generate a new random identifier and print it as a UUID (five groups of digits separated by hyphens):
`systemd-id128 new --uuid`
`systemd-id128 new {{[-u|--uuid]}}`

View file

@ -10,12 +10,12 @@
- Specify an image policy:
`systemd-machine-id-setup --image-policy={{your_policy}}`
`systemd-machine-id-setup --image-policy {{your_policy}}`
- Display the output as JSON:
`sudo systemd-machine-id-setup --json=pretty`
`sudo systemd-machine-id-setup --json pretty`
- Operate on a disk image instead of a directory tree:
`systemd-machine-id-setup --image={{/path/to/image}}`
`systemd-machine-id-setup --image {{/path/to/image}}`

View file

@ -17,16 +17,16 @@
- Create an automount point that mounts the actual file system at the time of first access:
`systemd-mount --automount=yes {{path/to/file_or_device}}`
`systemd-mount --automount yes {{path/to/file_or_device}}`
- Unmount one or more devices:
`systemd-mount --umount {{path/to/mount_point_or_device1}} {{path/to/mount_point_or_device2}}`
`systemd-mount {{[-u|--umount]}} {{path/to/mount_point_or_device1}} {{path/to/mount_point_or_device2}}`
- Mount a file system (image or block device) with a specific file system type:
`systemd-mount --type={{file_system_type}} {{path/to/file_or_device}} {{path/to/mount_point}}`
`systemd-mount {{[-t|--type]}} {{file_system_type}} {{path/to/file_or_device}} {{path/to/mount_point}}`
- Mount a file system (image or block device) with additional mount options:
`systemd-mount --options={{mount_options}} {{path/to/file_or_device}} {{path/to/mount_point}}`
`systemd-mount {{[-o|--options]}} {{mount_options}} {{path/to/file_or_device}} {{path/to/mount_point}}`

View file

@ -14,4 +14,4 @@
- Provide a custom status message to systemd (this information is shown by `systemctl status`):
`systemd-notify --status="{{Add custom status message here...}}"`
`systemd-notify --status "{{Add custom status message here...}}"`

View file

@ -5,16 +5,16 @@
- Run a command in a container:
`systemd-nspawn --directory {{path/to/container_root}}`
`systemd-nspawn {{[-D|--directory]}} {{path/to/container_root}}`
- Run a full Linux-based OS in a container:
`systemd-nspawn --boot --directory {{path/to/container_root}}`
`systemd-nspawn {{[-b|--boot]}} {{[-D|--directory]}} {{path/to/container_root}}`
- Run the specified command as PID 2 in the container (as opposed to PID 1) using a stub init process:
`systemd-nspawn --directory {{path/to/container_root}} --as-pid2`
`systemd-nspawn {{[-D|--directory]}} {{path/to/container_root}} {{[-a|--as-pid2]}}`
- Specify the machine name and hostname:
`systemd-nspawn --machine={{container_name}} --hostname={{container_host}} --directory {{path/to/container_root}}`
`systemd-nspawn {{[-M|--machine]}} {{container_name}} --hostname {{container_host}} {{[-D|--directory]}} {{path/to/container_root}}`

View file

@ -11,8 +11,8 @@
- View changes without applying:
`systemd-repart --dry-run=yes`
`systemd-repart --dry-run yes`
- Grow root partition size to 10 gigabytes:
`systemd-repart --size=10G --root /`
`systemd-repart --size 10G --root /`

View file

@ -13,11 +13,11 @@
- 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):
@ -25,12 +25,12 @@
- 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}}`

View file

@ -21,4 +21,4 @@
- Activate a service with a specified port:
`systemd-socket-activate {{path/to/socket.service}} {{{[-l|--listen]}}} {{8080}}`
`systemd-socket-activate {{path/to/socket.service}} {{[-l|--listen]}} {{8080}}`

View file

@ -14,8 +14,8 @@
- Forward `stdin`/`stdout` to the local system bus within a specific container:
`systemd-stdio-bridge --machine={{mycontainer}}`
`systemd-stdio-bridge {{[-M|--machine]}} {{mycontainer}}`
- Forward `stdin`/`stdout` to a custom D-Bus address:
`systemd-stdio-bridge --bus-path=unix:path={{/custom/dbus/socket}}`
`systemd-stdio-bridge {{[-p|--bus-path]}} unix:path={{/custom/dbus/socket}}`