Update cheatsheets

This commit is contained in:
ivuorinen
2025-09-30 00:19:36 +00:00
parent 883e910225
commit 4cdd94d474
8 changed files with 140 additions and 8 deletions

25
tldr/linux/systemctl-bind Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl bind
> Ephemerally bind-mount a file or directory from the host into a unit's mount namespace.
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html#%0A%20%20%20%20%20%20%20%20%20%20%20%20bind%0A%20%20%20%20%20%20%20%20%20%20%20%20UNIT%0A%20%20%20%20%20%20%20%20%20%20%20%20PATH%0A%20%20%20%20%20%20%20%20%20%20%20%20%5BPATH%5D%0A%20%20%20%20%20%20%20%20%20%20>.
- Bind-mount a host path into the same location inside the unit:
`systemctl bind {{unit}} /{{path/to/host_directory}}`
- Bind-mount a host path into a different location inside the unit:
`systemctl bind {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`
- Bind-mount a path as read-only inside the unit:
`systemctl bind --read-only {{unit}} /{{path/to/host_directory}}`
- Create the destination path inside the unit before binding:
`systemctl bind --mkdir {{unit}} /{{path/to/host_directory}} /{{path/to/unit_directory}}`