mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
Update cheatsheets
This commit is contained in:
@@ -15,7 +15,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Log in with a service principal using a client secret:
|
||||
|
||||
`az login --service-principal {{[-u|--username]}} {{http://azure-cli-service-principal}} {{[-p|--password]}} {{secret}} --tenant {{someone.onmicrosoft.com}}`
|
||||
`az login --service-principal {{[-u|--username]}} {{http://azure-cli-service-principal}} {{[-p|--password]}} {{secret}} {{[-t|--tenant]}} {{someone.onmicrosoft.com}}`
|
||||
|
||||
- Log in with a service principal using a client certificate:
|
||||
|
||||
|
||||
29
tldr/brew-tap
Normal file
29
tldr/brew-tap
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# brew tap
|
||||
|
||||
> Tap a Homebrew formula repository. If no arguments are provided, list all installed Homebrew taps.
|
||||
> More information: <https://docs.brew.sh/Manpage#tap-options-userrepo-url>.
|
||||
|
||||
- List installed Homebrew taps:
|
||||
|
||||
`brew tap`
|
||||
|
||||
- Tap a Git repository hosted on GitHub:
|
||||
|
||||
`brew tap {{github_username}}/{{github_repository_name}}`
|
||||
|
||||
- Tap a Git repository hosted outside of GitHub:
|
||||
|
||||
`brew tap {{username}}/{{repository_name}} {{git_clone_url}}`
|
||||
|
||||
- Tap a repository hosted on GitLab:
|
||||
|
||||
`brew tap {{username}}/{{repository_name}} https://gitlab.com/{{username}}/{{repository_name}}.git`
|
||||
|
||||
- Display help:
|
||||
|
||||
`brew tap {{[-h|--help]}}`
|
||||
@@ -6,7 +6,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
# clido
|
||||
|
||||
> Save-state TODO app for the terminal.
|
||||
> More information: <https://codeberg.org/Oglo12/clido/wiki>.
|
||||
> More information: <https://gitlab.com/Oglo12/clido-legacy#how-to-use>.
|
||||
|
||||
- Create a list:
|
||||
|
||||
|
||||
29
tldr/code2prompt
Normal file
29
tldr/code2prompt
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# code2prompt
|
||||
|
||||
> Generate AI-ready prompts from a codebase (extracts, filters and formats code for LLMs).
|
||||
> More information: <https://code2prompt.dev/docs/how_to/filter_files/>.
|
||||
|
||||
- Generate a prompt for the current project and copy it to the clipboard (default behaviour):
|
||||
|
||||
`code2prompt {{path/to/project}}`
|
||||
|
||||
- Include only specific files and exclude a directory:
|
||||
|
||||
`code2prompt {{path/to/project}} {{[-i|--include]}} "{{**/*.rs}}" {{[-e|--exclude]}} "{{tests/**}}"`
|
||||
|
||||
- Write the prompt to a file instead of the clipboard:
|
||||
|
||||
`code2prompt {{path/to/project}} {{[-O|--output-file]}} {{my_prompt.txt}}`
|
||||
|
||||
- Produce structured JSON output:
|
||||
|
||||
`code2prompt {{path/to/project}} {{[-F|--output-format]}} json`
|
||||
|
||||
- Use a custom Handlebars template when generating the prompt:
|
||||
|
||||
`code2prompt {{path/to/project}} {{[-t|--template]}} {{my_template.hbs}}`
|
||||
@@ -9,10 +9,6 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> Some subcommands such as `run` and `secrets` have their own usage documentation.
|
||||
> More information: <https://docs.doppler.com/docs/cli>.
|
||||
|
||||
- Setup Doppler CLI in the current directory:
|
||||
|
||||
`doppler setup`
|
||||
|
||||
- Setup Doppler project and configuration in current directory:
|
||||
|
||||
`doppler setup`
|
||||
|
||||
8
tldr/fd
8
tldr/fd
@@ -5,8 +5,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# fd
|
||||
|
||||
> An alternative to `find`.
|
||||
> Aims to be faster and easier to use than `find`.
|
||||
> Find entries in the filesystem.
|
||||
> See also: `find`.
|
||||
> More information: <https://github.com/sharkdp/fd#how-to-use>.
|
||||
|
||||
- Recursively find files matching a specific pattern in the current directory:
|
||||
@@ -29,6 +29,10 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`fd {{[-H|--hidden]}} {{[-I|--no-ignore]}} "{{string|regex}}"`
|
||||
|
||||
- Exclude files that match a specific `regex`:
|
||||
|
||||
`fd {{string}} {{[-E|--exclude]}} {{regex}}`
|
||||
|
||||
- Execute a command on each search result returned:
|
||||
|
||||
`fd "{{string|regex}}" {{[-x|--exec]}} {{command}}`
|
||||
|
||||
@@ -10,8 +10,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Run the specified command if and only if `stdin` is not empty:
|
||||
|
||||
`ifne {{command options ...}}`
|
||||
`ifne {{command}} {{command_options}}`
|
||||
|
||||
- Run the specified command if and only if `stdin` is empty, otherwise pass `stdin` to `stdout`:
|
||||
|
||||
`ifne -n {{command options ...}}`
|
||||
`ifne -n {{command}} {{command_options}}`
|
||||
|
||||
33
tldr/jj-diffedit
Normal file
33
tldr/jj-diffedit
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# jj diffedit
|
||||
|
||||
> Touch up the content changes in a revision with a diff editor.
|
||||
> More information: <https://jj-vcs.github.io/jj/latest/cli-reference/#jj-diffedit>.
|
||||
|
||||
- Edit changes in the current revision with a diff editor:
|
||||
|
||||
`jj diffedit`
|
||||
|
||||
- Edit changes in a given revision:
|
||||
|
||||
`jj diffedit {{[-r|--revision]}} {{revset}}`
|
||||
|
||||
- Edit changes comparing a "from" revision to a "to" revision:
|
||||
|
||||
`jj diffedit {{[-f|--from]}} {{from_revset}} {{[-t|--to]}} {{to_revset}}`
|
||||
|
||||
- Edit only specific paths (unmatched paths remain unchanged):
|
||||
|
||||
`jj diffedit {{filesets}}`
|
||||
|
||||
- Use a specific diff editor:
|
||||
|
||||
`jj diffedit --tool {{name}}`
|
||||
|
||||
- Preserve content instead of diff when rebasing descendants:
|
||||
|
||||
`jj diffedit --restore-descendants`
|
||||
@@ -9,22 +9,26 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
> This generates files named "xx00", "xx01", and so on.
|
||||
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/csplit-invocation.html>.
|
||||
|
||||
- Split a file at lines 5 and 23:
|
||||
- Split a file in two parts, starting the second one at line 10:
|
||||
|
||||
`csplit {{path/to/file}} 5 23`
|
||||
`csplit {{path/to/file}} 10`
|
||||
|
||||
- Split a file every 5 lines (this will fail if the total number of lines is not divisible by 5):
|
||||
- Split a file in three parts, starting the latter parts in lines 7 and 23:
|
||||
|
||||
`csplit {{path/to/file}} 7 23`
|
||||
|
||||
- Start a new part at every 5th line (will fail if number of lines is not divisible by 5):
|
||||
|
||||
`csplit {{path/to/file}} 5 {*}`
|
||||
|
||||
- Split a file every 5 lines, ignoring exact-division error:
|
||||
- Start a new part at every 5th line, ignoring exact-division error:
|
||||
|
||||
`csplit {{[-k|--keep-files]}} {{path/to/file}} 5 {*}`
|
||||
|
||||
- Split a file at line 5 and use a custom prefix for the output files:
|
||||
- Split a file above line 5 and use a custom prefix for the output files (default is `xx`):
|
||||
|
||||
`csplit {{path/to/file}} 5 {{[-f|--prefix]}} {{prefix}}`
|
||||
|
||||
- Split a file at a line matching a `regex`:
|
||||
- Split a file above the first line matching a `regex` pattern:
|
||||
|
||||
`csplit {{path/to/file}} /{{regex}}/`
|
||||
|
||||
21
tldr/linux/koji-help
Normal file
21
tldr/linux/koji-help
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# koji help
|
||||
|
||||
> Display help information for Koji commands.
|
||||
> More information: <https://docs.pagure.org/koji/HOWTO/#exploring-koji>.
|
||||
|
||||
- Display all available commands:
|
||||
|
||||
`koji help`
|
||||
|
||||
- Display help for specific subcommand (such as `build`, `call`, `cancel`, `tag-build`, etc.):
|
||||
|
||||
`koji help {{subcommand}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`koji {{[-h|--help]}}`
|
||||
22
tldr/linux/systemctl-reenable
Normal file
22
tldr/linux/systemctl-reenable
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# systemctl reenable
|
||||
|
||||
> Re-enable one or more units.
|
||||
> Used when targets of a service change.
|
||||
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html#reenable%20UNIT%E2%80%A6>.
|
||||
|
||||
- Re-enable a unit, restoring its default symlinks:
|
||||
|
||||
`systemctl reenable {{unit}}`
|
||||
|
||||
- Re-enable multiple units at once:
|
||||
|
||||
`systemctl reenable {{unit1 unit2 ...}}`
|
||||
|
||||
- Re-enable a unit and start it immediately:
|
||||
|
||||
`systemctl reenable {{unit}} --now`
|
||||
34
tldr/linux/systemctl-service-log-target
Normal file
34
tldr/linux/systemctl-service-log-target
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# systemctl service-log-target
|
||||
|
||||
> Get or set the log target for a service.
|
||||
> Only works for D-Bus integrated services.
|
||||
> More information: <https://www.freedesktop.org/software/systemd/man/systemctl.html#service-log-target%20SERVICE%20[TARGET]>.
|
||||
|
||||
- Show the current log target for a service:
|
||||
|
||||
`systemctl service-log-target {{service_name}}`
|
||||
|
||||
- Set the log target to `console` (send logs to `stderr`):
|
||||
|
||||
`systemctl service-log-target {{service_name}} console`
|
||||
|
||||
- Set the log target to `journal` (send logs to `systemd-journald`):
|
||||
|
||||
`systemctl service-log-target {{service_name}} journal`
|
||||
|
||||
- Set the log target to `syslog` (send logs to `/dev/log`):
|
||||
|
||||
`systemctl service-log-target {{service_name}} syslog`
|
||||
|
||||
- Allow systemd to choose an appropriate log target:
|
||||
|
||||
`systemctl service-log-target {{service_name}} auto`
|
||||
|
||||
- Disable all log output:
|
||||
|
||||
`systemctl service-log-target {{service_name}} null`
|
||||
@@ -7,11 +7,19 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
> Manage containerized command-line environments on Linux.
|
||||
> Some subcommands such as `create` have their own usage documentation.
|
||||
> More information: <https://manned.org/toolbox.1>.
|
||||
> More information: <https://manned.org/toolbox>.
|
||||
|
||||
- Run a `toolbox` subcommand:
|
||||
- Enter a container to use it interactively:
|
||||
|
||||
`toolbox {{subcommand}}`
|
||||
`toolbox enter {{container}}`
|
||||
|
||||
- Remove one or more containers:
|
||||
|
||||
`toolbox rm {{container1 container2 ...}}`
|
||||
|
||||
- Remove one or more images:
|
||||
|
||||
`toolbox rmi {{image1 image2 ...}}`
|
||||
|
||||
- Display help for a specific subcommand (such as `create`, `enter`, `rm`, `rmi`, etc.):
|
||||
|
||||
|
||||
34
tldr/linux/toybox
Normal file
34
tldr/linux/toybox
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, linux]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# toybox
|
||||
|
||||
> Multipurpose tool that provides many standard Unix utilities.
|
||||
> Commonly used in Android and embedded Linux systems.
|
||||
> More information: <https://landley.net/toybox/>.
|
||||
|
||||
- List all available Toybox commands:
|
||||
|
||||
`toybox`
|
||||
|
||||
- Run a Toybox command explicitly (useful if another command with the same name exists in `$PATH`):
|
||||
|
||||
`toybox {{command}} {{arguments}}`
|
||||
|
||||
- List files in the current directory:
|
||||
|
||||
`toybox ls`
|
||||
|
||||
- Remove a file:
|
||||
|
||||
`toybox rm {{path/to/file}}`
|
||||
|
||||
- Display help information for a specific command:
|
||||
|
||||
`toybox {{command}} --help`
|
||||
|
||||
- Display version:
|
||||
|
||||
`toybox --version`
|
||||
12
tldr/lolcat
12
tldr/lolcat
@@ -16,6 +16,18 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
`{{fortune}} | lolcat`
|
||||
|
||||
- Use a seed to generate consistent colors (default: `0` as in random):
|
||||
|
||||
`lolcat {{[-S|--seed]}} {{number}} {{path/to/file}}`
|
||||
|
||||
- Control rainbow frequency (default: `0.1`):
|
||||
|
||||
`lolcat {{[-F|--frequency]}} {{number}} {{path/to/file}}`
|
||||
|
||||
- Control rainbow smoothing (default: `3`):
|
||||
|
||||
`lolcat {{[-p|--spread]}} {{number}} {{path/to/file}}`
|
||||
|
||||
- Print a file to the console with animated rainbow colors:
|
||||
|
||||
`lolcat {{[-a|--animate]}} {{path/to/file}}`
|
||||
|
||||
@@ -18,8 +18,8 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Download the latest version of a package and add it to the list of dev dependencies in `package.json`:
|
||||
|
||||
`npm {{[i|install]}} {{[-D|--save-dev]}} {{package_name}}`
|
||||
`npm {{[i|install]}} {{package_name}} {{[-D|--save-dev]}}`
|
||||
|
||||
- Download the latest version of a package and install it globally:
|
||||
|
||||
`npm {{[i|install]}} {{[-g|--global]}} {{package_name}}`
|
||||
`npm {{[i|install]}} {{package_name}} {{[-g|--global]}}`
|
||||
|
||||
@@ -14,7 +14,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Remove a package globally:
|
||||
|
||||
`npm {{[r|uninstall]}} {{[-g|--global]}} {{package_name}}`
|
||||
`npm {{[r|uninstall]}} {{package_name}} {{[-g|--global]}}`
|
||||
|
||||
- Remove multiple packages at once:
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Update a package globally:
|
||||
|
||||
`npm {{[up|update]}} {{[-g|--global]}} {{package}}`
|
||||
`npm {{[up|update]}} {{package}} {{[-g|--global]}}`
|
||||
|
||||
- Update multiple packages at once:
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Initialize (or re-encrypt) the storage using one or more GPG IDs:
|
||||
|
||||
`pass init {{gpg_id_1}} {{gpg_id_2}}`
|
||||
`pass init {{gpg_id_1 gpg_id_2 ...}}`
|
||||
|
||||
- Save a new password and additional information (press `<Ctrl d>` on a new line to complete):
|
||||
|
||||
|
||||
10
tldr/stow
10
tldr/stow
@@ -12,20 +12,20 @@ source: https://github.com/tldr-pages/tldr.git
|
||||
|
||||
- Symlink all files recursively to a given directory:
|
||||
|
||||
`stow {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}`
|
||||
`stow {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Delete symlinks recursively from a given directory:
|
||||
|
||||
`stow {{[-D|--delete]}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}`
|
||||
`stow {{[-D|--delete]}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Simulate to see what the result would be like:
|
||||
|
||||
`stow {{[-n|--simulate]}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}`
|
||||
`stow {{[-n|--simulate]}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Delete and resymlink:
|
||||
|
||||
`stow {{[-R|--restow]}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}`
|
||||
`stow {{[-R|--restow]}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
- Exclude files matching a `regex`:
|
||||
|
||||
`stow --ignore={{regex}} {{[-t|--target]}} {{path/to/target_directory}} {{file1 directory1 file2 directory2}}`
|
||||
`stow --ignore={{regex}} {{[-t|--target]}} {{path/to/target_directory}} {{path/to/file_or_directory1 path/to/file_or_directory2 ...}}`
|
||||
|
||||
33
tldr/ttyd
Normal file
33
tldr/ttyd
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# ttyd
|
||||
|
||||
> Share a terminal or any command over the web.
|
||||
> More information: <https://github.com/tsl0922/ttyd#command-line-options>.
|
||||
|
||||
- Start a read only web server sharing Bash shell on the default port (7681):
|
||||
|
||||
`ttyd bash`
|
||||
|
||||
- Start Bash on a specific port:
|
||||
|
||||
`ttyd {{[-p|--port]}} {{8080}} bash`
|
||||
|
||||
- Allow clients to write to the terminal:
|
||||
|
||||
`ttyd {{[-W|--writable]}} {{command}}`
|
||||
|
||||
- Set client options:
|
||||
|
||||
`ttyd {{[-t|--client-option]}} {{key=value}} {{command}}`
|
||||
|
||||
- Display help:
|
||||
|
||||
`ttyd {{[-h|--help]}}`
|
||||
|
||||
- Display version:
|
||||
|
||||
`ttyd {{[-v|--version]}}`
|
||||
37
tldr/yek
Normal file
37
tldr/yek
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
syntax: markdown
|
||||
tags: [tldr, common]
|
||||
source: https://github.com/tldr-pages/tldr.git
|
||||
---
|
||||
# yek
|
||||
|
||||
> Serialize a repository or directory into an LLM-friendly single file (fast Rust-based repomapper).
|
||||
> More information: <https://github.com/bodo-run/yek#usage>.
|
||||
|
||||
- Serialize the current directory and write the output to a temp file (prints path):
|
||||
|
||||
`yek`
|
||||
|
||||
- Serialize specific directories and write output to a directory:
|
||||
|
||||
`yek {{path/to/directory1 path/to/directory2 ...}} --output-dir {{path/to/output_directory}}`
|
||||
|
||||
- Process multiple files or use glob patterns (quote globs to avoid shell expansion):
|
||||
|
||||
`yek "{{path/to/directory/**/*.rs}}" "{{path/to/directory/**/*.md}}"`
|
||||
|
||||
- Cap the token-based output size to 128k tokens:
|
||||
|
||||
`yek {{path/to/directory}} --tokens 128k`
|
||||
|
||||
- Cap the byte-based max output size and set an explicit output file name:
|
||||
|
||||
`yek {{path/to/directory}} --max-size {{100KB}} --output-name {{yek-output.txt}}`
|
||||
|
||||
- Stream JSON output:
|
||||
|
||||
`yek {{path/to/directory}} --json`
|
||||
|
||||
- Include a directory tree header in the output:
|
||||
|
||||
`yek {{path/to/directory}} --tree-header`
|
||||
Reference in New Issue
Block a user