mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-02-08 22:46:13 +00:00
Update cheatsheets
This commit is contained in:
12
tldr/case
12
tldr/case
@@ -10,8 +10,16 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Match a variable against string literals to decide which command to run:
|
||||
|
||||
`case {{$tocount}} in {{words}}) {{wc -w README}}; ;; {{lines}}) {{wc -l README}}; ;; esac`
|
||||
`case {{$COUNTRULE}} in {{words}}) {{wc -w README}} ;; {{lines}}) {{wc -l README}} ;; esac`
|
||||
|
||||
- Combine patterns with |, use * as a fallback pattern:
|
||||
|
||||
`case {{$tocount}} in {{[wW]|words}}) {{wc -w README}}; ;; {{[lL]|lines}}) {{wc -l README}}; ;; *) {{echo "what?"}}; ;; esac`
|
||||
`case {{$COUNTRULE}} in {{[wW]|words}}) {{wc -w README}} ;; {{[lL]|lines}}) {{wc -l README}} ;; *) {{echo "what?"}}; ;; esac`
|
||||
|
||||
- Allow matching multiple patterns:
|
||||
|
||||
`case {{$ANIMAL}} in {{cat}}) echo "It's a cat" ;;& {{cat|dog}}) echo "It's a cat or a dog" ;;& *) echo "Fallback" ;; esac`
|
||||
|
||||
- Continue to the next pattern's commands without checking the pattern:
|
||||
|
||||
`case {{$ANIMAL}} in {{cat}}) echo "It's a cat" ;& {{dog}}) echo "It's either a dog or cat fell through" ;& *) echo "Fallback" ;; esac`
|
||||
|
||||
@@ -19,3 +19,11 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
- Return the number of installed fonts in your system:
|
||||
|
||||
`fc-list | wc -l`
|
||||
|
||||
- Return a list of installed fonts that support the language based on its locale code:
|
||||
|
||||
`fc-list :lang={{jp}}`
|
||||
|
||||
- Return a list of installed fonts that contain the glyph specified by its Unicode code-point:
|
||||
|
||||
`fc-list :charset={{f303}}`
|
||||
|
||||
2
tldr/if
2
tldr/if
@@ -39,4 +39,4 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- List all possible conditions (`test` is an alias to `[`; both are commonly used with `if`):
|
||||
|
||||
`man [`
|
||||
`man test`
|
||||
|
||||
25
tldr/kubectl-wait
Normal file
25
tldr/kubectl-wait
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# kubectl wait
|
||||
|
||||
> Wait for resource(s) to reach a certain state.
|
||||
> More information: <https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#wait>.
|
||||
|
||||
- Wait for a deployment to become available:
|
||||
|
||||
`kubectl wait --for=condition=available deployment/{{deployment_name}}`
|
||||
|
||||
- Wait for all pods with a certain [l]abel to be ready:
|
||||
|
||||
`kubectl wait --for=condition=ready pod -l {{label_key}}={{label_value}}`
|
||||
|
||||
- Wait for a pod to be deleted:
|
||||
|
||||
`kubectl wait --for=delete pod {{pod_name}}`
|
||||
|
||||
- Wait for a job to complete, within 120 seconds (if the condition isn't met on time, the exit status will be unsuccessful):
|
||||
|
||||
`kubectl wait --for=condition=complete job/{{job_name}} --timeout 120s`
|
||||
26
tldr/linux/scriptlive
Normal file
26
tldr/linux/scriptlive
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# scriptlive
|
||||
|
||||
> Execute a typescript created by the `script` command in real-time.
|
||||
> See also: `script`.
|
||||
> More information: <https://manned.org/scriptlive>.
|
||||
|
||||
- Execute a typescript in real-time:
|
||||
|
||||
`scriptlive {{path/to/timing_file}} {{path/to/typescript}}`
|
||||
|
||||
- Execute a typescript at double the original speed:
|
||||
|
||||
`scriptlive {{path/to/timing_file}} {{path/to/typescript}} --divisor 2`
|
||||
|
||||
- Execute a typescript created using `--log-in` option of `script`:
|
||||
|
||||
`scriptlive --log-in {{path/to/stdin_log_file}} {{path/to/typescript}}`
|
||||
|
||||
- Execute a typescript waiting at most 2 seconds between each command:
|
||||
|
||||
`scriptlive {{path/to/timing_file}} {{path/to/typescript}} --maxdelay 2`
|
||||
Reference in New Issue
Block a user