Update cheatsheets

This commit is contained in:
ivuorinen
2025-12-24 00:21:36 +00:00
parent 4e6886aa1f
commit 70f6f2ac08
27 changed files with 174 additions and 69 deletions

View File

@@ -18,9 +18,9 @@ source: https://github.com/tldr-pages/tldr.git
- Reverse a TCP port from a specific emulator or device (by device ID / [s]erial number) to localhost:
`adb -s {{device_ID}} adb reverse tcp:{{remote_port}} tcp:{{local_port}}`
`adb -s {{device_ID}} reverse tcp:{{remote_port}} tcp:{{local_port}}`
- Remove a reverse socket connections from an emulator or device:
- Remove a reverse socket connection from an emulator or device:
`adb reverse --remove tcp:{{remote_port}}`

View File

@@ -5,7 +5,7 @@ source: https://github.com/tldr-pages/tldr.git
---
# ani-cli
> A cli to browse and watch anime.
> Browse and watch anime.
> See also: `animdl`.
> More information: <https://manned.org/ani-cli>.
@@ -27,7 +27,7 @@ source: https://github.com/tldr-pages/tldr.git
- Use VLC as the media player:
`ani-cli {{[-v|-vlc]}} "{{anime_title}}"`
`ani-cli {{[-v|--vlc]}} "{{anime_title}}"`
- Watch a specific episode:

View File

@@ -12,13 +12,13 @@ source: https://github.com/tldr-pages/tldr.git
`bzgrep "{{search_pattern}}" {{path/to/file}}`
- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
- Recursively search files in a bzip2 compressed `.tar` archive for a pattern:
`bzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
`bzgrep {{[-r|--recursive]}} "{{search_pattern}}" {{path/to/tar_file}}`
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
`bzgrep --{{context|before-context|after-context}} {{3}} "{{search_pattern}}" {{path/to/file}}`
`bzgrep {{--context|--before-context|--after-context}} 3 "{{search_pattern}}" {{path/to/file}}`
- Print file name and line number for each match:
@@ -28,10 +28,10 @@ source: https://github.com/tldr-pages/tldr.git
`bzgrep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}`
- Recursively search files in a bzip2 compressed `.tar` archive for a pattern:
`bzgrep {{[-r|--recursive]}} "{{search_pattern}}" {{path/to/tar_file}}`
- Search `stdin` for lines that do not match a pattern:
`cat {{path/to/bz_compressed_file}} | bzgrep {{[-v|--invert-match]}} "{{search_pattern}}"`
- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
`bzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`

View File

@@ -34,7 +34,7 @@ source: https://github.com/tldr-pages/tldr.git
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
`codespell --{{context|before-context|after-context}} 3`
`codespell {{--context|--before-context|--after-context}} 3`
- Check file names for typos, in addition to file contents:

View File

@@ -10,11 +10,11 @@ source: https://github.com/tldr-pages/tldr.git
- Copy a file to another location:
`cp {{path/to/source_file.ext}} {{path/to/target_file.ext}}`
`cp {{path/to/source_file}} {{path/to/target_file}}`
- Copy a file into another directory, keeping the filename:
`cp {{path/to/source_file.ext}} {{path/to/target_parent_directory}}`
`cp {{path/to/source_file}} {{path/to/target_parent_directory}}`
- Recursively copy a directory's contents to another location (if the destination exists, the directory is copied inside it):

View File

@@ -9,7 +9,7 @@ source: https://github.com/tldr-pages/tldr.git
> See also: `regex`.
> More information: <https://www.gnu.org/software/grep/manual/grep.html>.
- Search for a pattern within a file:
- Search for a pattern within files:
`grep "{{search_pattern}}" {{path/to/file1 path/to/file2 ...}}`
@@ -17,13 +17,9 @@ source: https://github.com/tldr-pages/tldr.git
`grep {{[-F|--fixed-strings]}} "{{exact_string}}" {{path/to/file}}`
- Search for a pattern in all files recursively in a directory, showing line numbers of matches, ignoring binary files:
- Search for a pattern in all files recursively in a directory, ignoring binary files:
`grep {{[-rnI|--recursive --line-number --binary-files=without-match]}} "{{search_pattern}}" {{path/to/directory}}`
- Use extended `regex`es (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
`grep {{[-Ei|--extended-regexp --ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
`grep {{[-rI|--recursive --binary-files=without-match]}} "{{search_pattern}}" {{path/to/directory}}`
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
@@ -33,10 +29,14 @@ source: https://github.com/tldr-pages/tldr.git
`grep {{[-Hn|--with-filename --line-number]}} --color=always "{{search_pattern}}" {{path/to/file}}`
- Search for lines matching a pattern, printing only the matched text:
- Print only the matched text:
`grep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}`
- Read data from `stdin` and do not print lines that match a pattern:
`cat {{path/to/file}} | grep {{[-v|--invert-match]}} "{{search_pattern}}"`
- Use extended `regex`es (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
`grep {{[-Ei|--extended-regexp --ignore-case]}} "{{search_pattern}}" {{path/to/file}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# id
> Display current user and group identity.
> See also: `logname`.
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/id-invocation.html>.
- Display current user's ID (UID), group ID (GID), and groups to which they belong:

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Display keypress information:
`sudo keyd monitor`
`sudo keyd {{[-m|monitor]}}`
- Reset bindings and reload the configuration files in `/etc/keyd`:
@@ -24,6 +24,10 @@ source: https://github.com/tldr-pages/tldr.git
`keyd list-keys`
- Check the detected configuration files for errors:
`keyd check`
- Create a temporary binding:
`sudo keyd bind "{{pressed_key}} = {{output_key}}"`

View File

@@ -36,6 +36,6 @@ source: https://github.com/tldr-pages/tldr.git
`lsblk {{[-e|--exclude]}} {{1,7,...}}`
- Display a customized summary using a comma-separated list of columns:
- Add extra information to the output using a comma-separated list of columns (omit the `+` sign to only display the specified columns):
`lsblk {{[-o|--output]}} {{NAME,ROTA,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...}}`
`lsblk {{[-o|--output]}} +{{NAME,ROTA,SERIAL,MODEL,TRAN,TYPE,SIZE,FSTYPE,MOUNTPOINT,...}}`

View File

@@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
# quickemu
> Build and manage highly optimised desktop virtual machines quickly.
> Note: Virtual machine must be in stopped state when working with snapshots.
> See also: `quickget` for preparing VM configurations.
> More information: <https://github.com/quickemu-project/quickemu>.
@@ -33,6 +34,10 @@ source: https://github.com/tldr-pages/tldr.git
`quickemu --snapshot apply {{tag}} --vm {{path/to/file.conf}}`
- List available snapshots:
`quickemu --snapshot info --vm {{path/to/file.conf}}`
- Delete a snapshot:
`quickemu --snapshot delete {{tag}} --vm {{path/to/file.conf}}`

View File

@@ -9,34 +9,34 @@ source: https://github.com/tldr-pages/tldr.git
> See also: `awk`, `ed`.
> More information: <https://www.gnu.org/software/sed/manual/sed.html>.
- Replace "apple" with "mango" on all lines using basic `regex`, print to `stdout`:
- [s]ubstitute all occurrences of "apple" with "mango" on all lines, print to `stdout`:
`{{command}} | sed 's/apple/mango/g'`
- Replace "apple" with "APPLE" on all lines using extended `regex`, print to `stdout`:
- Replace "apple" with "mango" in-place in a file (overwriting original file):
`{{command}} | sed {{[-E|--regexp-extended]}} 's/(apple)/\U\1/g'`
`sed {{[-i|--in-place]}} 's/apple/mango/g' {{path/to/file}}`
- Use basic `regex` to replace "apple" with "mango" and "orange" with "lime" in-place in a file (overwriting original file):
- Run multiple substitutions in one command:
`sed {{[-i|--in-place]}} -e 's/apple/mango/g' -e 's/orange/lime/g' {{path/to/file}}`
`{{command}} | sed -e '{{s/apple/mango/g}}' -e '{{s/orange/lime/g}}'`
- Execute a specific `sed` script file and print the result to `stdout`:
- Use a custom delimiter (useful when the pattern contains slashes):
`{{command}} | sed {{[-f|--file]}} {{path/to/script.sed}}`
- [p]rint only the first line to `stdout`:
`{{command}} | sed {{[-n|--quiet]}} '1p'`
`{{command}} | sed '{{s#////#____#g}}'`
- [d]elete lines 1 to 5 of a file and back up the original file with a `.orig` extension:
`sed {{[-i|--in-place=]}}{{.orig}} '1,5d' {{path/to/file}}`
- [i]nsert a new line at the beginning of a file, overwriting the original file in-place:
- [p]rint only the first line to `stdout`:
`{{command}} | sed {{[-n|--quiet]}} '1p'`
- [i]nsert a new line at the beginning of a file, overwriting the original file:
`sed {{[-i|--in-place]}} '1i\your new line text\' {{path/to/file}}`
- Delete blank lines (with or without spaces/tabs) from a file, overwriting the original file in-place:
- Delete blank lines (with or without spaces/tabs) from a file, overwriting the original file:
`sed {{[-i|--in-place]}} '/^[[:space:]]*$/d' {{path/to/file}}`

View File

@@ -15,16 +15,16 @@ source: https://github.com/tldr-pages/tldr.git
- Don't cut the description off at the end of the line:
`whatis --long {{command}}`
`whatis {{[-l|--long]}} {{command}}`
- Display descriptions for all commands matching a glob:
`whatis --wildcard {{net*}}`
`whatis {{[-w|--wildcard]}} {{net*}}`
- Search man page descriptions with a `regex`:
`whatis --regex '{{wish[0-9]\.[0-9]}}'`
`whatis {{[-r|--regex]}} '{{wish[0-9]\.[0-9]}}'`
- Display descriptions in a specific language:
`whatis --locale={{en}} {{command}}`
`whatis {{[-L|--locale]}} {{en}} {{command}}`

View File

@@ -10,15 +10,15 @@ source: https://github.com/tldr-pages/tldr.git
- Print the default web browser:
`xdg-settings get {{default-web-browser}}`
`xdg-settings get default-web-browser`
- Set the default web browser to Firefox:
`xdg-settings set {{default-web-browser}} {{firefox.desktop}}`
`xdg-settings set default-web-browser {{firefox.desktop}}`
- Set the default mail URL scheme handler to Evolution:
`xdg-settings set {{default-url-scheme-handler}} {{mailto}} {{evolution.desktop}}`
`xdg-settings set default-url-scheme-handler mailto {{evolution.desktop}}`
- Set the default PDF document viewer:

View File

@@ -12,7 +12,7 @@ source: https://github.com/tldr-pages/tldr.git
`man {{command}}`
- Open the man page for a command in a browser (`$BROWSER` environment variable can replace `=browser_name`):
- Open the man page for a command in a browser (`=browser_name` can be omitted if `$BROWSER` is set):
`man {{[-H|--html=]}}{{browser_name}} {{command}}`

37
tldr/ng-add Normal file
View File

@@ -0,0 +1,37 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# ng add
> Add and configure packages for the current workspace project.
> More information: <https://angular.dev/cli/add>.
- Add a package to the current project:
`ng add {{package}}`
- Add multiple packages:
`ng add {{package1 package2 ...}}`
- Add a specific version of a package:
`ng add {{package}}@{{version}}`
- Skip the confirmation prompt:
`ng add {{package}} --skip-confirmation`
- Disable interactive prompts:
`ng add {{package}} --interactive false`
- Display verbose output about internal operations:
`ng add {{package}} --verbose`
- Perform a dry run without making any changes:
`ng add {{package}} {{[-d|--dry-run]}}`

View File

@@ -20,14 +20,14 @@ source: https://github.com/tldr-pages/tldr.git
`radare2 -i {{path/to/script.r2}} {{path/to/binary}}`
- Display help text for any command in the interactive CLI:
- [Interactive] Display help text for any command:
`{{radare2_command}}?`
- Run a shell command from the interactive CLI:
- [Interactive] Run a shell command from the interactive CLI:
`!{{shell_command}}`
- Dump raw bytes of current block to a file:
- [Interactive] Dump raw bytes of current block to a file:
`> pr > {{path/to/file.bin}}`
`pr > {{path/to/file.bin}}`

21
tldr/regedit Normal file
View File

@@ -0,0 +1,21 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# regedit
> Wine registry counterpart of the Microsoft Windows `regedit` service.
> More information: <https://manned.org/regedit>.
- Export a specific registry key and contents to a file:
`regedit -E {{path/to/file}} {{path/to/registry_key}}`
- Delete a specified registry key:
`regedit -D {{path/to/registry_key}}`
- Display help:
`regedit -?`

View File

@@ -17,6 +17,10 @@ source: https://github.com/tldr-pages/tldr.git
`rg {{pattern}} {{path/to/file_or_directory}}`
- Search for a literal string pattern:
`rg {{[-F|--fixed-strings]}} -- {{string}}`
- Include hidden files and entries listed in `.gitignore`:
`rg {{[-.|--hidden]}} --no-ignore {{pattern}}`
@@ -36,7 +40,3 @@ source: https://github.com/tldr-pages/tldr.git
- Show lines that do not match the pattern:
`rg {{[-v|--invert-match]}} {{pattern}}`
- Search for a literal string pattern:
`rg {{[-F|--fixed-strings]}} -- {{string}}`

View File

@@ -20,6 +20,6 @@ source: https://github.com/tldr-pages/tldr.git
`shuf {{path/to/input_file}} {{[-o|--output]}} {{path/to/output_file}}`
- Generate 3 random numbers in the range 1-10 (inclusive):
- Generate 3 random numbers in the range 1-10 (inclusive, numbers can repeat):
`shuf {{[-n|--head-count]}} 3 {{[-i|--input-range]}} 1-10 {{[-r|--repeat]}}`

View File

@@ -24,7 +24,7 @@ source: https://github.com/tldr-pages/tldr.git
`sort {{[-n|--numeric-sort]}} {{path/to/file}}`
- Sort `/etc/passwd` by the 3rd field of each line numerically, using `:` as a field separator:
- Sort `/etc/passwd` by the 3rd field onward of each line numerically, using `:` as a field separator:
`sort {{[-t|--field-separator]}} : {{[-k|--key]}} 3n /etc/passwd`

25
tldr/tailscale-funnel Normal file
View File

@@ -0,0 +1,25 @@
---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# tailscale funnel
> Share a local server on the internet using Tailscale.
> More information: <https://tailscale.com/kb/1311/tailscale-funnel>.
- Expose a local file or directory in the foreground:
`tailscale funnel {{path/to/file_or_directory}}`
- Expose an HTTP server running at 127.0.0.1:3000 in the foreground:
`tailscale funnel 3000`
- Expose an HTTP server running at 127.0.0.1:3000 in the background:
`tailscale funnel --bg 3000`
- Expose an HTTPS server with invalid or self-signed certificates at https://localhost:8443:
`tailscale funnel https+insecure://localhost:8443`

View File

@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
- Set the file [a]ccess or [m]odification times to the current one and don't create file if it doesn't exist:
`touch {{[-c|--no-create]}} -{{a|m}} {{path/to/file1 path/to/file2 ...}}`
`touch {{[-c|--no-create]}} {{-a|-m}} {{path/to/file1 path/to/file2 ...}}`
- Set the file [t]ime to a specific value and don't create file if it doesn't exist:

View File

@@ -29,3 +29,11 @@ source: https://github.com/tldr-pages/tldr.git
- Display number of occurrences of each line, sorted by the most frequent:
`sort {{path/to/file}} | uniq {{[-c|--count]}} | sort {{[-nr|--numeric-sort --reverse]}}`
- Compare only the first 10 characters on each line for uniqueness:
`sort {{path/to/file}} | uniq {{[-w|--check-chars]}} 10`
- Compare text after the first 5 characters on each line for uniqueness:
`sort {{path/to/file}} | uniq {{[-s|--skip-chars]}} 5`

View File

@@ -20,6 +20,10 @@ source: https://github.com/tldr-pages/tldr.git
`uptime {{[-s|--since]}}`
- Display the time data in seconds:
`uptime {{[-r|--raw]}}`
- Display version:
`uptime {{[-V|--version]}}`

View File

@@ -24,9 +24,9 @@ source: https://github.com/tldr-pages/tldr.git
`uv pip uninstall {{package}}`
- Save installed packages to file:
- Lock dependencies from `pyproject.toml` to `requirements.txt`:
`uv pip freeze > {{requirements.txt}}`
`uv pip compile pyproject.toml {{[-o|--output-file]}} requirements.txt`
- List installed packages:

View File

@@ -21,13 +21,9 @@ source: https://github.com/tldr-pages/tldr.git
`xzgrep {{[-n|--line-number]}} "{{search_pattern}}" {{path/to/file}}`
- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
`xzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
`xzgrep --{{context|before-context|after-context}} {{3}} "{{search_pattern}}" {{path/to/file}}`
`xzgrep {{--context|--before-context|--after-context}} 3 "{{search_pattern}}" {{path/to/file}}`
- Print file name and line number for each match with color output:
@@ -36,3 +32,7 @@ source: https://github.com/tldr-pages/tldr.git
- Search for lines matching a pattern, printing only the matched text:
`xzgrep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}`
- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`), in case-insensitive mode:
`xzgrep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}`

View File

@@ -12,6 +12,10 @@ source: https://github.com/tldr-pages/tldr.git
`zgrep {{pattern}} {{path/to/compressed_file}}`
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
`zgrep {{--context|--before-context|--after-context}} 3 {{pattern}} {{path/to/compressed_file}}`
- Grep a pattern in a compressed file (case-insensitive):
`zgrep {{[-i|--ignore-case]}} {{pattern}} {{path/to/compressed_file}}`
@@ -28,10 +32,6 @@ source: https://github.com/tldr-pages/tldr.git
`zgrep {{[-e|--regexp]}} "{{pattern_1}}" {{[-e|--regexp]}} "{{pattern_2}}" {{path/to/compressed_file}}`
- Use extended `regex` (supporting `?`, `+`, `{}`, `()`, and `|`):
- Use extended `regex` (supports `?`, `+`, `{}`, `()`, and `|`):
`zgrep {{[-E|--extended-regexp]}} {{regex}} {{path/to/file}}`
- Print 3 lines of [C]ontext around, [B]efore, or [A]fter each match:
`zgrep --{{context|before-context|after-context}} 3 {{pattern}} {{path/to/compressed_file}}`