Update cheatsheets

This commit is contained in:
ivuorinen
2025-10-23 00:19:46 +00:00
parent 0cc7cfe867
commit 058ce19122
64 changed files with 437 additions and 86 deletions

View File

@@ -11,12 +11,12 @@ source: https://github.com/tldr-pages/tldr.git
- Observe the first parameter and return value of method, and expand the nested attributes of the object to 4 levels:
`watch {{class-pattern}} {{method-pattern}} {{'{ params[0],returnObj }'}} -x 4`
`watch {{class-pattern}} {{method-pattern}} '{{{ params[0],returnObj }}}' -x 4`
- When the value of the first parameter of the method is 5, the second parameter and return value are output, and the object is expanded 4 layers:
`watch {{class-pattern}} {{method-pattern}} {{'{ params[1],returnObj }'}} {{'"5".equals(params[0])'}} -x 4`
`watch {{class-pattern}} {{method-pattern}} '{{{ params[1],returnObj }}}' '{{"5".equals(params[0])}}' -x 4`
- When the method returns or an exception occurs, observe the count property of the second parameter:
`watch {{class-pattern}} {{method-pattern}} {{'{ params[1].count }'}} -e -s`
`watch {{class-pattern}} {{method-pattern}} '{{{ params[1].count }}}' -e -s`

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Specify a [C]onfiguration command:
`babeld -C {{'redistribute metric 256'}}`
`babeld -C '{{redistribute metric 256}}'`
- Specify on which interfaces to operate:

25
tldr/brew-reinstall Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# brew reinstall
> Uninstall and then reinstall a formula or cask using the same options it was originally installed with.
> More information: <https://docs.brew.sh/Manpage#reinstall-options-formulacask->.
- Reinstall a formula/cask:
`brew reinstall {{formula|cask}}`
- Reinstall a formula/cask and show verification and post-install steps:
`brew reinstall {{[-v|--verbose]}} {{formula|cask}}`
- Make some output more quiet:
`brew reinstall {{[-q|--quiet]}} {{formula|cask}}`
- Display help:
`brew reinstall {{[-h|--help]}}`

View File

@@ -14,8 +14,8 @@ source: https://github.com/tldr-pages/tldr.git
- Print a phrase formatted as [i]mperative verb + past tense [v]erb + [a]djective + plural [N]oun:
`buzzphrase {{'{i} {v} {a} {N}'}}`
`buzzphrase '{{{i} {v} {a} {N}}}'`
- Print `k` phrases formatted as present participle [V]erb + [a]djective + singular [n]oun + [f]inal:
`buzzphrase {{k}} {{'{V} {a} {n} {f}'}}`
`buzzphrase {{k}} '{{{V} {a} {n} {f}}}'`

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- 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`
`case {{$ANIMAL}} in {{cat}}) {{echo "It's a cat"}} ;& {{dog}}) {{echo "It's either a dog or cat fell through"}} ;& *) {{echo "Fallback"}} ;; esac`
- Display help:

View File

@@ -22,19 +22,19 @@ source: https://github.com/tldr-pages/tldr.git
- Create a `www` subdomain pointing to a relative record in the same zone:
`cli53 {{[rc|rrcreate]}} {{example.com}} {{'www 300 CNAME lb'}}`
`cli53 {{[rc|rrcreate]}} {{example.com}} '{{www 300 CNAME lb}}'`
- Create a `www` subdomain pointing to an external address (must end with a dot):
`cli53 {{[rc|rrcreate]}} {{example.com}} {{'www 300 CNAME lb.example.com.'}}`
`cli53 {{[rc|rrcreate]}} {{example.com}} '{{www 300 CNAME lb.example.com.}}'`
- Create a `www` subdomain pointing to an IP address:
`cli53 {{[rc|rrcreate]}} {{example.com}} {{'www 300 A 150.130.110.1'}}`
`cli53 {{[rc|rrcreate]}} {{example.com}} '{{www 300 A 150.130.110.1}}'`
- Replace a `www` subdomain pointing to a different IP:
`cli53 {{[rc|rrcreate]}} --replace {{'www 300 A 150.130.110.2'}}`
`cli53 {{[rc|rrcreate]}} --replace '{{www 300 A 150.130.110.2}}'`
- Delete a record A:

View File

@@ -24,15 +24,15 @@ source: https://github.com/tldr-pages/tldr.git
- Send form-encoded data (POST request of type `application/x-www-form-urlencoded`). Use `--data @file_name` or `--data @'-'` to read from `stdin`:
`curl {{[-X|--request]}} POST {{[-d|--data]}} {{'name=bob'}} {{http://example.com/form}}`
`curl {{[-X|--request]}} POST {{[-d|--data]}} '{{name=bob}}' {{http://example.com/form}}`
- Send a request with an extra header, using a custom HTTP method and over a proxy (such as BurpSuite), ignoring insecure self-signed certificates:
`curl {{[-k|--insecure]}} {{[-x|--proxy]}} {{http://127.0.0.1:8080}} {{[-H|--header]}} {{'Authorization: Bearer token'}} {{[-X|--request]}} {{GET|PUT|POST|DELETE|PATCH|...}} {{https://example.com}}`
`curl {{[-k|--insecure]}} {{[-x|--proxy]}} {{http://127.0.0.1:8080}} {{[-H|--header]}} '{{Authorization: Bearer token}}' {{[-X|--request]}} {{GET|PUT|POST|DELETE|PATCH|...}} {{https://example.com}}`
- Send data in JSON format, specifying the appropriate Content-Type header:
`curl {{[-d|--data]}} {{'{"name":"bob"}'}} {{[-H|--header]}} {{'Content-Type: application/json'}} {{http://example.com/users/1234}}`
`curl {{[-d|--data]}} '{{{"name":"bob"}}}' {{[-H|--header]}} '{{Content-Type: application/json}}' {{http://example.com/users/1234}}`
- Pass client certificate and private key for the request, skipping certificate validation:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Scan a URL using a header for authentication:
`dalfox url {{http://example.com}} {{[-H|--header]}} {{'X-My-Header: 123'}}`
`dalfox url {{http://example.com}} {{[-H|--header]}} '{{X-My-Header: 123}}'`
- Scan a list of URLs from a file:

View File

@@ -30,4 +30,4 @@ source: https://github.com/tldr-pages/tldr.git
- Add custom headers as JSON (e.g., '{"X-Custom": "Value"}'):
`dockdiver -url {{https://example.com}} -list -headers {{'{"X-Custom": "Value"}'}}`
`dockdiver -url {{https://example.com}} -list -headers '{{{"X-Custom": "Value"}}}'`

View File

@@ -24,13 +24,13 @@ source: https://github.com/tldr-pages/tldr.git
`du {{[-ah|--all --human-readable]}} {{path/to/directory}}`
- List the human-readable sizes of a directory and any subdirectories, up to N levels deep:
- List the human-readable sizes of a directory and any subdirectories, up to `n` levels deep:
`du {{[-h|--human-readable]}} {{[-d|--max-depth]}} N {{path/to/directory}}`
`du {{[-h|--human-readable]}} {{[-d|--max-depth]}} {{n}} {{path/to/directory}}`
- List the human-readable size of all `.jpg` files in current directory, and show a cumulative total at the end:
`du {{[-ch|--total --human-readable]}} {{./*.jpg}}`
`du {{[-ch|--total --human-readable]}} *.jpg`
- List all files and directories (including hidden ones) above a certain threshold size (useful for investigating what is actually taking up the space):

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Rebuild and test with `make` if any `.c` source files in the current directory change:
`{{ls *.c}} | entr {{'make && make test'}}`
`{{ls *.c}} | entr '{{make && make test}}'`
- Send a `SIGTERM` to any previously spawned ruby subprocesses before executing `ruby main.rb`:
@@ -30,7 +30,7 @@ source: https://github.com/tldr-pages/tldr.git
- Rebuild the project if source files change, limiting output to the first few lines:
`{{find src/}} | entr -s {{'make | sed 10q'}}`
`{{find src/}} | entr -s '{{make | sed 10q}}'`
- Launch and auto-[r]eload a Node.js server:

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Publish an Electrode Native container to a local Maven repository:
`ern publish-container --publisher {{maven}} --platform {{android}} --extra {{'{"groupId":"com.walmart.ern","artifactId":"quickstart"}'}}`
`ern publish-container --publisher {{maven}} --platform {{android}} --extra '{{{"groupId":"com.walmart.ern","artifactId":"quickstart"}}}'`
- Transform an iOS container into a pre-compiled binary framework:

View File

@@ -30,4 +30,4 @@ source: https://github.com/tldr-pages/tldr.git
- Rename the file, prepending the date and time from metadata (not from the file timestamp):
`exiv2 {{[-r|--rename]}} {{'%Y%m%d_%H%M%S_:basename:'}} {{path/to/file}}`
`exiv2 {{[-r|--rename]}} '{{%Y%m%d_%H%M%S_:basename:}}' {{path/to/file}}`

View File

@@ -19,7 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
- Replace a `regex` in a specific directory in files filtered with a case-insensitive glob pattern:
`fastmod {{regex}} {{replacement}} --dir {{path/to/directory}} --iglob {{'**/*.{js,json}'}}`
`fastmod {{regex}} {{replacement}} --dir {{path/to/directory}} --iglob '{{**/*.{js,json}}}'`
- Replace for an exact string in `.js` or JSON files:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Specify an editor to open with:
`fc -e {{'emacs'}}`
`fc -e '{{emacs}}'`
- List recent commands from history:

View File

@@ -26,11 +26,11 @@ source: https://github.com/tldr-pages/tldr.git
- Sign a new session cookie with a secret key:
`flask-unsign {{[-s|--sign]}} {{[-c|--cookie]}} {{"{'logged_in': False}"}} {{[-S|--secret]}} {{secret}}`
`flask-unsign {{[-s|--sign]}} {{[-c|--cookie]}} "{{{'logged_in': False}}}" {{[-S|--secret]}} {{secret}}`
- Sign a session cookie using legacy timestamp (useful for old versions):
`flask-unsign {{[-s|--sign]}} {{[-c|--cookie]}} {{"{'logged_in': False}"}} {{[-S|--secret]}} {{secret}} {{[-l|--legacy]}}`
`flask-unsign {{[-s|--sign]}} {{[-c|--cookie]}} "{{{'logged_in': False}}}" {{[-S|--secret]}} {{secret}} {{[-l|--legacy]}}`
- Brute-force a session cookie with custom threads and no literal evaluation:

View File

@@ -10,7 +10,7 @@ source: https://github.com/tldr-pages/tldr.git
- Select full path and size from temporary or configuration files in a given directory:
`fselect size, path from {{path/to/directory}} where name = {{'*.cfg'}} or name = {{'*.tmp'}}`
`fselect size, path from {{path/to/directory}} where name = '{{*.cfg}}' or name = {{'*.tmp'}}`
- Find square images:

18
tldr/git-lfs-transfer Normal file
View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git-lfs-transfer
> Server-side implementation of the Git LFS pure SSH transfer protocol.
> Allows Git LFS to upload and download large files over SSH instead of HTTPS.
> More information: <https://github.com/charmbracelet/git-lfs-transfer#usage>.
- Upload large files tracked by Git LFS to a repository:
`git-lfs-transfer {{path/to/repo.git}} upload`
- Download large files tracked by Git LFS from a repository:
`git-lfs-transfer {{path/to/repo.git}} download`

View File

@@ -32,9 +32,9 @@ source: https://github.com/tldr-pages/tldr.git
`git log {{[-i|--regexp-ignore-case]}} --grep {{search_string}}`
- Show the last N number of commits from a certain author:
- Show the last `n` number of commits from a certain author:
`git log {{[-n|--max-count]}} {{number}} --author "{{author}}"`
`git log {{[-n|--max-count]}} {{n}} --author "{{author}}"`
- Show commits between two dates (yyyy-mm-dd):

29
tldr/git-merge-index Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git merge-index
> Run a merge program on files that need merging.
> More information: <https://git-scm.com/docs/git-merge-index>.
- Merge all files needing resolution using the standard helper:
`git merge-index git-merge-one-file -a`
- Merge a specific file:
`git merge-index git-merge-one-file -- {{path/to/file}}`
- Merge multiple files, continuing on failures:
`git merge-index -o git-merge-one-file -- {{path/to/file1 path/to/file2 ...}}`
- Quietly merge all files with a custom program:
`git merge-index -q {{merge-program}} -a`
- Inspect merge inputs for a file using `cat`:
`git merge-index cat -- {{path}}`

25
tldr/git-merge-one-file Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git merge-one-file
> Resolve a single file merge after a trivial merge.
> More information: <https://git-scm.com/docs/git-merge-one-file>.
- Resolve a simple merge conflict for a file:
`git merge-one-file {{path/to/file}}`
- Use as a helper in merge-index for a file:
`git merge-index git-merge-one-file {{path/to/file}}`
- Handle a binary file merge:
`git merge-one-file -p {{path/to/file}}`
- Apply after read-tree in a scripted merge:
`git read-tree -m {{branch1}} {{branch2}} && git merge-index git-merge-one-file {{path/to/file}}`

29
tldr/git-p4 Normal file
View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# git p4
> Import from and submit to Perforce repositories.
> More information: <https://git-scm.com/docs/git-p4>.
- Clone a Perforce depot into a new Git repository:
`git p4 clone {{path/to/p4_depot}}`
- Sync changes from Perforce into the current Git repository:
`git p4 sync {{path/to/p4_depot}}`
- Rebase local commits on top of the latest Perforce changes:
`git p4 rebase`
- Submit Git changes back to Perforce:
`git p4 submit`
- Clone the full Perforce history instead of only the latest changelist:
`git p4 clone {{path/to/p4_depot}}@all`

View File

@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
- Send a request with a header and a body:
`grpcurl -H "{{Authorization: Bearer $token}}" -d {{'{"foo": "bar"}'}} {{grpc.server.com:443}} {{my.custom.server.Service/Method}}`
`grpcurl -H "{{Authorization: Bearer $token}}" -d '{{{"foo": "bar"}}}' {{grpc.server.com:443}} {{my.custom.server.Service/Method}}`
- List all services exposed by a server:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Join two files using a comma (instead of a space) as the field separator:
`join -t {{','}} {{path/to/file1}} {{path/to/file2}}`
`join -t '{{,}}' {{path/to/file1}} {{path/to/file2}}`
- Join field3 of file1 with field1 of file2:

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Align two or more sequences, custom tabular output format, output to file:
`blastn -query {{query.fa}} -subject {{subject.fa}} -outfmt {{'6 qseqid qlen qstart qend sseqid slen sstart send bitscore evalue pident'}} -out {{output.tsv}}`
`blastn -query {{query.fa}} -subject {{subject.fa}} -outfmt '{{6 qseqid qlen qstart qend sseqid slen sstart send bitscore evalue pident}}' -out {{output.tsv}}`
- Search nucleotide databases using a nucleotide query, 16 threads (CPUs) to use in the BLAST search, with a maximum number of 10 aligned sequences to keep:

View File

@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
- Search the protein database using a query and `regex`:
`esearch -db {{protein}} -query {{'Escherichia*'}}`
`esearch -db {{protein}} -query '{{Escherichia*}}'`
- Search the nucleotide database for sequences whose metadata contain insulin and rodents:

View File

@@ -9,7 +9,7 @@ source: https://github.com/tldr-pages/tldr.git
> See also: `date` for Unix time information and `umount` for unmounting partitions.
> More information: <https://extundelete.sourceforge.net/options.html>.
- Restore all deleted files inside partition N on device X:
- Restore all deleted files inside partition `N` on device `X`:
`sudo extundelete {{/dev/sdXN}} --restore-all`

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Set MPV as the default application for all audio files:
`handlr set {{'audio/*'}} {{mpv.desktop}}`
`handlr set '{{audio/*}}' {{mpv.desktop}}`
- List all default apps:

View File

@@ -8,6 +8,18 @@ source: https://github.com/tldr-pages/tldr.git
> Output the first part of files.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/head-invocation.html>.
- Show first 10 lines in a file:
`head {{path/to/file}}`
- Show first 10 lines of multiple files:
`head {{path/to/file1 path/to/file2 ...}}`
- Output the first 5 lines of a file:
`head {{[-5|--lines 5]}} {{path/to/file}}`
- Output the first few lines of a file:
`head {{[-n|--lines]}} {{count}} {{path/to/file}}`

View File

@@ -28,7 +28,7 @@ source: https://github.com/tldr-pages/tldr.git
- Prepend "foo" to all filenames in the current directory:
`rename {{''}} {{'foo'}} {{*}}`
`rename '' '{{foo}}' {{*}}`
- Rename a group of increasingly numbered files zero-padding the numbers up to 3 digits:

View File

@@ -19,11 +19,11 @@ source: https://github.com/tldr-pages/tldr.git
- Add a user-defined rule that labels any path which matches a PCRE `regex`:
`sudo semanage fcontext {{[-a|--add]}} {{[-t|--type]}} {{samba_share_t}} {{'/mnt/share(/.*)?'}}`
`sudo semanage fcontext {{[-a|--add]}} {{[-t|--type]}} {{samba_share_t}} '{{/mnt/share(/.*)?}}'`
- Delete a user-defined rule using its PCRE `regex`:
`sudo semanage fcontext {{[-d|--delete]}} {{'/mnt/share(/.*)?'}}`
`sudo semanage fcontext {{[-d|--delete]}} '{{/mnt/share(/.*)?}}'`
- Relabel a directory recursively by applying the new rules:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Set multiple keyboard layouts, their variants and switching option:
`setxkbmap -layout {{us,de}} -variant {{,qwerty}} -option {{'grp:alt_caps_toggle'}}`
`setxkbmap -layout {{us,de}} -variant {{,qwerty}} -option '{{grp:alt_caps_toggle}}'`
- List all layouts:

View File

@@ -0,0 +1,18 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# systemctl revert
> Revert unit files to their vendor versions.
> Undoes the effects of `edit`, `enable`, `disable`, `set-property`, and `mask`.
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html#revert%20UNIT%E2%80%A6>.
- Revert unit files to their default settings:
`systemctl revert {{unit1 unit2 ...}}`
- Revert a user unit file:
`systemctl revert {{unit}} --user`

33
tldr/linux/wev Normal file
View File

@@ -0,0 +1,33 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# wev
> Print contents of Wayland events.
> More information: <https://manned.org/wev>.
- Monitor all occurring Wayland events:
`wev`
- Print all events received by a specific Wayland interface:
`wev -f {{wl_keyboard}}`
- Print only specific events received by a Wayland interface:
`wev -f {{wl_keyboard}}:{{key}}`
- Print everything but the specified wayland events:
`wev -F {{wl_keyboard}}:{{key}}`
- Write the `wl_keyboards`'s keymap to a file:
`wev -M {{path/to/file}}`
- Print Wayland globals:
`wev -g`

View File

@@ -26,4 +26,4 @@ source: https://github.com/tldr-pages/tldr.git
- Open the terminal using a Serif font and a font size equal to 20:
`xterm -fa {{'Serif'}} -fs {{20}}`
`xterm -fa '{{Serif}}' -fs {{20}}`

View File

@@ -22,6 +22,10 @@ source: https://github.com/tldr-pages/tldr.git
`magick {{path/to/input_image.png}} -resize {{50}}% {{path/to/output_image.png}}`
- Scale an image to have a specified file size:
`magick {{path/to/input_image.png}} -define jpeg:extent={{512kb}} {{path/to/output_image.jpg}}`
- Create a GIF out of all JPEG images in the current directory:
`magick {{*.jpg}} {{path/to/images.gif}}`

View File

@@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
- Scale an image to have a specified file size:
`magick convert {{path/to/input_image.png}} -define jpeg:extent=512kb {{path/to/output_image.jpg}}`
`magick convert {{path/to/input_image.png}} -define jpeg:extent={{512kb}} {{path/to/output_image.jpg}}`
- Vertically/horizontally append images and have the empty space be transparent:

21
tldr/minio-server Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# minio server
> MinIO server command for starting the MinIO S3 compatible storage engine.
> More information: <https://docs.min.io/enterprise/aistor-object-store/reference/aistor-server/>.
- Start a server using the default configuration:
`minio server {{path/to/data_directory}}`
- Start a server binding to a different port for the API and web console:
`minio server --address ":{{port}}" --console-address ":{{port}}" {{path/to/data_directory}}`
- Start a server as part of a cluster of 2 nodes:
`minio server {{node1_hostname}} {{path/to/data_directory}} {{node2_hostname}} {{path/to/data_directory}}`

41
tldr/msgattrib Normal file
View File

@@ -0,0 +1,41 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# msgattrib
> Filter and manipulate message attributes in `.po` translation files.
> More information: <https://www.gnu.org/software/gettext/manual/html_node/msgattrib-Invocation.html>.
- Keep only translated messages:
`msgattrib --translated {{input.po}} > {{translated.po}}`
- Keep only untranslated messages:
`msgattrib --untranslated {{input.po}} > {{untranslated.po}}`
- Remove fuzzy messages:
`msgattrib --no-fuzzy {{input.po}} > {{clean.po}}`
- Keep only fuzzy messages:
`msgattrib --only-fuzzy {{input.po}} > {{fuzzy.po}}`
- Mark all messages as fuzzy:
`msgattrib --set-fuzzy {{input.po}} > {{fuzzy.po}}`
- Clear fuzzy marks:
`msgattrib --clear-fuzzy {{input.po}} > {{clean.po}}`
- Sort output by file location:
`msgattrib {{[-F|--sort-by-file]}} {{input.po}} > {{sorted.po}}`
- Display help:
`msgattrib {{[-h|--help]}}`

View File

@@ -20,6 +20,6 @@ source: https://github.com/tldr-pages/tldr.git
`afplay --rate {{0.5}} {{path/to/file}}`
- Play the first N seconds of a sound file:
- Play the first `n` seconds of a sound file:
`afplay --time {{seconds}} {{path/to/file}}`
`afplay --time {{n}} {{path/to/file}}`

View File

@@ -24,10 +24,10 @@ source: https://github.com/tldr-pages/tldr.git
`du -ah {{path/to/directory}}`
- List the human-readable sizes of a directory and any subdirectories, up to N levels deep:
- List the human-readable sizes of a directory and any subdirectories, up to `n` levels deep:
`du -h -d {{2}} {{path/to/directory}}`
`du -h -d {{n}} {{path/to/directory}}`
- List the human-readable size of all `.jpg` files in subdirectories of the current directory, and show a cumulative total at the end:
`du -ch {{*/*.jpg}}`
`du -ch */*.jpg`

View File

@@ -29,6 +29,6 @@ source: https://github.com/tldr-pages/tldr.git
`tail -F {{path/to/file}}`
- Show last 'count' lines in 'file' and refresh every 'seconds' seconds:
- Show last `count` lines in a file and refresh every `seconds` seconds:
`tail -n {{8}} -s {{10}} -f {{path/to/file}}`
`tail -n {{count}} -s {{seconds}} -f {{path/to/file}}`

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Provide a custom filename template:
`pageres {{https://example.com/}} {{1024x768}} --filename={{'<%= date %> - <%= url %>'}}`
`pageres {{https://example.com/}} {{1024x768}} --filename='{{<%= date %> - <%= url %>}}'`
- Capture a specific element on a page:

View File

@@ -20,9 +20,9 @@ source: https://github.com/tldr-pages/tldr.git
`pastel pick`
- Generate a set of N visually distinct colors:
- Generate a set of `n` visually distinct colors:
`pastel distinct {{8}}`
`pastel distinct {{n}}`
- List all X11/CSS color names:

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Do a case-insensitive search for lines that begin with "foo" and return the first 3 matches:
`pdfgrep {{[-m|--max-count]}} {{3}} {{[-i|--ignore-case]}} {{'^foo'}} {{file.pdf}}`
`pdfgrep {{[-m|--max-count]}} {{3}} {{[-i|--ignore-case]}} '{{^foo}}' {{file.pdf}}`
- Find pattern in files with a `.pdf` extension in the current directory recursively:
@@ -26,4 +26,4 @@ source: https://github.com/tldr-pages/tldr.git
- Find pattern on files that match a specific glob in the current directory recursively:
`pdfgrep {{[-r|--recursive]}} --include {{'*book.pdf'}} {{pattern}}`
`pdfgrep {{[-r|--recursive]}} --include '{{*book.pdf}}' {{pattern}}`

View File

@@ -15,16 +15,16 @@ source: https://github.com/tldr-pages/tldr.git
- Output a WAV [f]ile using a [m]odel and specifying its JSON [c]onfig file:
`echo {{'Thing to say'}} | piper -m {{path/to/model.onnx}} -c {{path/to/model.onnx.json}} -f {{outputfile.wav}}`
`echo {{Thing to say}} | piper -m {{path/to/model.onnx}} -c {{path/to/model.onnx.json}} -f {{outputfile.wav}}`
- Select a particular speaker in a voice with multiple speakers by specifying the speaker's ID number:
`echo {{'Warum?'}} | piper -m {{de_DE-thorsten_emotional-medium.onnx}} --speaker {{1}} -f {{angry.wav}}`
`echo {{Warum?}} | piper -m {{de_DE-thorsten_emotional-medium.onnx}} --speaker {{1}} -f {{angry.wav}}`
- Stream the output to the mpv media player:
`echo {{'Hello world'}} | piper -m {{en_GB-northern_english_male-medium.onnx}} --output-raw -f - | mpv -`
`echo {{Hello world}} | piper -m {{en_GB-northern_english_male-medium.onnx}} --output-raw -f - | mpv -`
- Speak twice as fast, with huge gaps between sentences:
`echo {{'Speaking twice the speed. With added drama!'}} | piper -m {{foo.onnx}} --length_scale {{0.5}} --sentence_silence {{2}} -f {{drama.wav}}`
`echo {{Speaking twice the speed. With added drama!}} | piper -m {{foo.onnx}} --length_scale {{0.5}} --sentence_silence {{2}} -f {{drama.wav}}`

30
tldr/poetry-source Normal file
View File

@@ -0,0 +1,30 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# poetry source
> Add source configurations to your Poetry project.
> See also: `asdf`.
> More information: <https://python-poetry.org/docs/cli/#source>.
- Add a source configuration:
`poetry source add {{source_name}} {{source_url}}`
- Set the priority of a source:
`poetry source add --priority {{primary|supplemental|explicit}} {{source_name}} {{source_url}}`
- Display info for all sources:
`poetry source show`
- Display info for a specific source:
`poetry source show {{source_name}}`
- Remove a source from your `pyproject.toml` file:
`poetry source remove {{source_name}}`

View File

@@ -19,7 +19,7 @@ source: https://github.com/tldr-pages/tldr.git
- Send data to a task's `stdin`:
`pueue send {{task_id}} {{"hello"}}`
`pueue send {{task_id}} "{{hello}}"`
- View a task's `stdout` and `stderr`, as well as basic information about that task:

View File

@@ -22,7 +22,7 @@ source: https://github.com/tldr-pages/tldr.git
- Search for resources in Pulumi Cloud using Pulumi AI with a plaintext natural language query:
`pulumi org search ai {{[-q|--query]}} {{"show me all load balancers in my organization"}}`
`pulumi org search ai {{[-q|--query]}} "{{show me all load balancers in my organization}}"`
- Display help:

View File

@@ -14,24 +14,24 @@ source: https://github.com/tldr-pages/tldr.git
- Connect to a database (e.g. PostgreSQL):
`rsql --url {{"postgresql://user:pass@localhost/mydb"}}`
`rsql --url "{{postgresql://user:pass@localhost/mydb}}"`
- Connect to a PostgreSQL database with SSL:
`rsql --url {{"postgresql://user:pass@localhost/db?sslmode=require"}}`
`rsql --url "{{postgresql://user:pass@localhost/db?sslmode=require}}"`
- Connect to a MySQL database with a specified charset:
`rsql --url {{"mysql://user:pass@localhost/db?charset=utf8mb4"}}`
`rsql --url "{{mysql://user:pass@localhost/db?charset=utf8mb4}}"`
- Run a query and exit:
`rsql --url {{"sqlite://database.db"}} -- "SELECT * FROM users LIMIT 10"`
`rsql --url "{{sqlite://database.db}}" -- "{{SELECT * FROM users LIMIT 10}}"`
- Set default format:
`rsql --url {{"sqlite://db.sqlite"}} --format json`
`rsql --url "{{sqlite://db.sqlite}}" --format json`
- Connect to file and use custom line separator:
`rsql --url {{"delimited://data.txt?separator=|&has_header=true"}}`
`rsql --url "{{delimited://data.txt?separator=|&has_header=true}}"`

View File

@@ -18,8 +18,8 @@ source: https://github.com/tldr-pages/tldr.git
- Find and replace in a specific file (output stream: `stdout`):
`sd {{[-p|--preview]}} {{'window.fetch'}} {{'fetch'}} {{path/to/file.js}}`
`sd {{[-p|--preview]}} '{{window.fetch}}' '{{fetch}}' {{path/to/file.js}}`
- Find and replace in all files in the current project (output stream: `stdout`):
`sd {{'from "react"'}} {{'from "preact"'}} "$(find . -type f)"`
`sd '{{from "react"}}' '{{from "preact"}}' "$(find . -type f)"`

View File

@@ -28,9 +28,9 @@ source: https://github.com/tldr-pages/tldr.git
`smbmap {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -d {{domain}} -H {{ip_or_hostname}}`
- Locate and download files [R]ecursively up to N levels depth, searching for filename pattern (`regex`), and excluding certain shares:
- Locate and download files [R]ecursively up to `n` levels depth, searching for filename pattern (`regex`), and excluding certain shares:
`smbmap --host-file {{path/to/file}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -q -R --depth {{number}} --exclude {{sharename}} -A {{filepattern}}`
`smbmap --host-file {{path/to/file}} {{[-u|--username]}} {{username}} {{[-p|--password]}} {{password}} -q -R --depth {{n}} --exclude {{sharename}} -A {{filepattern}}`
- Upload file through smb using username and password:

View File

@@ -9,6 +9,14 @@ source: https://github.com/tldr-pages/tldr.git
> See also: `head`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/tail-invocation.html>.
- Show last 10 lines in a file:
`tail {{path/to/file}}`
- Show last 10 lines of multiple files:
`tail {{path/to/file1 path/to/file2 ...}}`
- Show last 'count' lines in file:
`tail {{[-n|--lines]}} {{count}} {{path/to/file}}`
@@ -29,6 +37,6 @@ source: https://github.com/tldr-pages/tldr.git
`tail {{[-F|--retry --follow]}} {{path/to/file}}`
- Show last 'count' lines in 'file' and refresh every 'seconds' seconds:
- Show last `count` lines in a file and refresh every `seconds` seconds:
`tail {{[-n|--lines]}} {{count}} {{[-s|--sleep-interval]}} {{seconds}} {{[-f|--follow]}} {{path/to/file}}`

View File

@@ -30,12 +30,12 @@ source: https://github.com/tldr-pages/tldr.git
- Set the guest OS type (one of `VBoxManage list ostypes`) for the imported VM:
`VBoxManage import {{path/to/file.ovf}} --ostype={{ostype}}`
`VBoxManage import {{path/to/file.ovf}} --ostype {{ostype}}`
- Set the memory (in megabytes) for the imported VM:
`VBoxManage import {{path/to/file.ovf}} --memory={{1}}`
`VBoxManage import {{path/to/file.ovf}} --memory {{1}}`
- Set the number of CPUs for the imported VM:
`VBoxManage import {{path/to/file.ovf}} --cpus={{1}}`
`VBoxManage import {{path/to/file.ovf}} --cpus {{1}}`

View File

@@ -26,4 +26,4 @@ source: https://github.com/tldr-pages/tldr.git
- Start a virtual machine with an environment variable pair name value:
`VBoxManage startvm {{vm_name|uuid}} --put-env={{name}}={{value}}`
`VBoxManage startvm {{vm_name|uuid}} {{[-E|--putenv]}} {{name}}={{value}}`

View File

@@ -0,0 +1,29 @@
---
syntax: markdown
tags: [tldr, windows]
source: https://github.com/tldr-pages/tldr.git
---
# Compress-Archive
> A cmdlet in PowerShell is used to create compressed (zipped) archive files.
> More information: <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/compress-archive>.
- Compress a single file:
`Compress-Archive -Path {{path o ile.txt}} -DestinationPath {{path o ile.zip}}`
- Compress multiple files:
`Compress-Archive -Path {{path o ile1, path o ile2, ...}} -DestinationPath {{path o iles.zip}}`
- Compress a directory:
`Compress-Archive -Path {{path o\directory}} -DestinationPath {{path o\directory.zip}}`
- Update an existing archive:
`Compress-Archive -Path {{path o ile}} -DestinationPath {{path o\directory.zip}} -Update`
- Set compression level:
`Compress-Archive -Path {{path o\directory}} -DestinationPath {{path o\directory.zip}} -CompressionLevel {{Optimal|Fastest|NoCompression}}`

View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, windows]
source: https://github.com/tldr-pages/tldr.git
---
# Expand-Archive
> A cmdlet in PowerShell is used to extract files from a compressed archive.
> More information: <https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.archive/expand-archive>.
- Extract a ZIP file to a folder:
`Expand-Archive -Path {{path oxample.zip}} -DestinationPath {{path oxtracted_files}}`
- Overwrite existing files:
`Expand-Archive -Path {{path oxample.zip}} -DestinationPath {{path oxtracted_files}} -Force`
- Preview without extracting:
`Expand-Archive -Path {{path oxample.zip}} -DestinationPath {{path oxtracted_files}} -WhatIf`

View File

@@ -17,6 +17,6 @@ source: https://github.com/tldr-pages/tldr.git
`Get-History -Id {{id}}`
- Display the last N commands:
- Display the last `n` commands:
`Get-History -Count {{10}}`
`Get-History -Count {{n}}`

View File

@@ -23,7 +23,7 @@ source: https://github.com/tldr-pages/tldr.git
- Send data in JSON format, specifying the appropriate content-type header:
`Invoke-WebRequest -Body {{'{"name":"bob"}'}} -ContentType 'application/json' {{http://example.com/users/1234}}`
`Invoke-WebRequest -Body '{{{"name":"bob"}}}' -ContentType 'application/json' {{http://example.com/users/1234}}`
- Pass a username and password for server authentication:

View File

@@ -10,16 +10,24 @@ source: https://github.com/tldr-pages/tldr.git
- Show the status of a service (no service name will list all services):
`sc.exe query {{service_name}}`
`sc query {{service_name}}`
- Start a service asynchronously:
`sc.exe create {{service_name}} binpath= {{path o\service_binary_file}}`
`sc start {{service_name}}`
- Stop a service asynchronously:
`sc.exe delete {{service_name}}`
`sc stop {{service_name}}`
- Create a service:
`sc create {{service_name}} binpath= {{path o\service_binary_file}}`
- Delete a service:
`sc delete {{service_name}}`
- Set the type of a service:
`sc.exe config {{service_name}} type= {{service_type}}`
`sc config {{service_name}} type= {{service_type}}`

View File

@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
- Send parameters via POST body with JSON format:
`x8 {{[-u|--url]}} {{https://example.com/}} {{[-X|--method]}} {{POST}} {{[-b|--body]}} {{'{"x":{%s\}\}'}} {{[-w|--wordlist]}} {{path/to/wordlist.txt}}`
`x8 {{[-u|--url]}} {{https://example.com/}} {{[-X|--method]}} {{POST}} {{[-b|--body]}} '{{{"x":{%s\}\}}}' {{[-w|--wordlist]}} {{path/to/wordlist.txt}}`
- Check parameters with a custom template (`%k` for key, `%v` for value):

View File

@@ -18,4 +18,4 @@ source: https://github.com/tldr-pages/tldr.git
- View a CSV file with unconventional delimiters:
`x_x {{[-d|--delimiter]}} {{';'}} {{[-q|--quotechar]}} {{'|'}} {{file.csv}}`
`x_x {{[-d|--delimiter]}} '{{;}}' {{[-q|--quotechar]}} '{{|}}' {{file.csv}}`

View File

@@ -23,7 +23,7 @@ b' | xe -N{{2}} -s 'echo $2 $1'`
- Delete all files with a `.backup` extension:
`find . -name {{'*.backup'}} | xe rm -v`
`find . -name '{{*.backup}}' | xe rm -v`
- Run up to `max-jobs` processes in parallel; the default is 1. If `max-jobs` is 0, xe will run as many processes as cpu cores:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Print the title of all pages found by a Google search and download them:
`xidel {{https://www.google.com/search?q=test}} {{[-f|--follow]}} "{{//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']}}" {{[-e|--extract]}} {{//title}} --download {{'{$host}/'}}`
`xidel {{https://www.google.com/search?q=test}} {{[-f|--follow]}} "{{//a/extract(@href, 'url[?]q=([^&]+)&', 1)[. != '']}}" {{[-e|--extract]}} {{//title}} --download '{{{$host}/}}'`
- Follow all links on a page and print the titles, with XPath: