Update cheatsheets

This commit is contained in:
ivuorinen
2026-03-06 00:31:36 +00:00
parent 8c4faa0051
commit a0a2bbc19d
12 changed files with 120 additions and 16 deletions

View File

@@ -15,15 +15,15 @@ source: https://github.com/tldr-pages/tldr.git
- Run a command with a file lock, or exit if the lock is currently being held (with exit code 1):
`flock {{path/to/lock.lock}} {{[-n|--nonblock]}} {{command}}`
`flock {{[-n|--nonblock]}} {{path/to/lock.lock}} {{command}}`
- Run a command with a file lock, or exit with a specific error code if the lock is currently being held:
`flock {{path/to/lock.lock}} {{[-n|--nonblock]}} {{[-E|--conflict-exit-code]}} {{123}} {{command}}`
`flock {{[-n|--nonblock]}} {{[-E|--conflict-exit-code]}} {{123}} {{path/to/lock.lock}} {{command}}`
- Run a command with a file lock, waiting up to 10 seconds for the lock to be available before giving up:
`flock {{path/to/lock.lock}} {{[-w|--timeout]}} 10 {{command}}`
`flock {{[-w|--timeout]}} 10 {{path/to/lock.lock}} {{command}}`
- Backup a bunch of files, waiting for the previous `tar` command to finish if it's still running elsewhere and holding the same lock file (can be used in a `cron` job that runs often):