diff --git a/tldr/adb-reverse b/tldr/adb-reverse index 604bc64f..c84cc689 100644 --- a/tldr/adb-reverse +++ b/tldr/adb-reverse @@ -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}}` diff --git a/tldr/ani-cli b/tldr/ani-cli index 448e46cf..5c52945e 100644 --- a/tldr/ani-cli +++ b/tldr/ani-cli @@ -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: . @@ -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: diff --git a/tldr/bzgrep b/tldr/bzgrep index b190b029..d04109ab 100644 --- a/tldr/bzgrep +++ b/tldr/bzgrep @@ -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}}` diff --git a/tldr/codespell b/tldr/codespell index 571d2c50..9fcd1794 100644 --- a/tldr/codespell +++ b/tldr/codespell @@ -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: diff --git a/tldr/cp b/tldr/cp index cf191fd3..dbe289f2 100644 --- a/tldr/cp +++ b/tldr/cp @@ -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): diff --git a/tldr/grep b/tldr/grep index b5365ae8..8a3308b6 100644 --- a/tldr/grep +++ b/tldr/grep @@ -9,7 +9,7 @@ source: https://github.com/tldr-pages/tldr.git > See also: `regex`. > More information: . -- 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}}` diff --git a/tldr/id b/tldr/id index 02e94b7c..96671e29 100644 --- a/tldr/id +++ b/tldr/id @@ -6,6 +6,7 @@ source: https://github.com/tldr-pages/tldr.git # id > Display current user and group identity. +> See also: `logname`. > More information: . - Display current user's ID (UID), group ID (GID), and groups to which they belong: diff --git a/tldr/linux/keyd b/tldr/linux/keyd index 6884e763..a9ab2461 100644 --- a/tldr/linux/keyd +++ b/tldr/linux/keyd @@ -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}}"` diff --git a/tldr/linux/lsblk b/tldr/linux/lsblk index 29c639d3..e99fc7ee 100644 --- a/tldr/linux/lsblk +++ b/tldr/linux/lsblk @@ -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,...}}` diff --git a/tldr/linux/quickemu b/tldr/linux/quickemu index 3908ca61..5b690d2a 100644 --- a/tldr/linux/quickemu +++ b/tldr/linux/quickemu @@ -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: . @@ -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}}` diff --git a/tldr/linux/sed b/tldr/linux/sed index b09db203..fcc1b3b3 100644 --- a/tldr/linux/sed +++ b/tldr/linux/sed @@ -9,34 +9,34 @@ source: https://github.com/tldr-pages/tldr.git > See also: `awk`, `ed`. > More information: . -- 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}}` diff --git a/tldr/linux/whatis b/tldr/linux/whatis index ddd66955..9d221ba1 100644 --- a/tldr/linux/whatis +++ b/tldr/linux/whatis @@ -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}}` diff --git a/tldr/linux/xdg-settings b/tldr/linux/xdg-settings index 5462ae36..117392bf 100644 --- a/tldr/linux/xdg-settings +++ b/tldr/linux/xdg-settings @@ -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: diff --git a/tldr/man b/tldr/man index 5919063a..c75af992 100644 --- a/tldr/man +++ b/tldr/man @@ -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}}` diff --git a/tldr/ng-add b/tldr/ng-add new file mode 100644 index 00000000..535a49ef --- /dev/null +++ b/tldr/ng-add @@ -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: . + +- 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]}}` diff --git a/tldr/radare2 b/tldr/radare2 index 7d4a9731..c03aedf5 100644 --- a/tldr/radare2 +++ b/tldr/radare2 @@ -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}}` diff --git a/tldr/regedit b/tldr/regedit new file mode 100644 index 00000000..32f7e9e9 --- /dev/null +++ b/tldr/regedit @@ -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: . + +- 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 -?` diff --git a/tldr/rg b/tldr/rg index 71f7d6c8..422f3e99 100644 --- a/tldr/rg +++ b/tldr/rg @@ -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}}` diff --git a/tldr/shuf b/tldr/shuf index d1a1ca4a..2c058707 100644 --- a/tldr/shuf +++ b/tldr/shuf @@ -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]}}` diff --git a/tldr/sort b/tldr/sort index c25790c9..4e15dffe 100644 --- a/tldr/sort +++ b/tldr/sort @@ -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` diff --git a/tldr/tailscale-funnel b/tldr/tailscale-funnel new file mode 100644 index 00000000..9e504482 --- /dev/null +++ b/tldr/tailscale-funnel @@ -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: . + +- 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` diff --git a/tldr/touch b/tldr/touch index 9fca15c5..ec810134 100644 --- a/tldr/touch +++ b/tldr/touch @@ -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: diff --git a/tldr/uniq b/tldr/uniq index 8f981f75..fcbce695 100644 --- a/tldr/uniq +++ b/tldr/uniq @@ -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` diff --git a/tldr/uptime b/tldr/uptime index 0d49b463..a5c6f7aa 100644 --- a/tldr/uptime +++ b/tldr/uptime @@ -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]}}` diff --git a/tldr/uv-pip b/tldr/uv-pip index f30c41bb..a54881c3 100644 --- a/tldr/uv-pip +++ b/tldr/uv-pip @@ -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: diff --git a/tldr/xzgrep b/tldr/xzgrep index 16be448f..3e5b9c1e 100644 --- a/tldr/xzgrep +++ b/tldr/xzgrep @@ -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}}` diff --git a/tldr/zgrep b/tldr/zgrep index 845064f7..0a4b83bb 100644 --- a/tldr/zgrep +++ b/tldr/zgrep @@ -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}}`