# CommandSection

title: TLDR
content:
<b>Automatically choose the right build script to build packages in a clean chroot</b>`pkgctl build`<br><b>Manually build packages in a clean chroot</b>`pkgctl build --arch [architecture] --repo [repository] --clean`


title: TLDR
content:
<b>Apply the specified arithmetic function with n as the second argument to each sample in the specified PAM image</b>`pamfunc -[multiplier|divisor|adder|subtractor|min|max] [n] [path/to/input.pam] > [path/to/output.pam]`<br><b>Apply the specified bit string function with n as the second argument to each sample in the specified PAM image</b>`pamfunc -[andmask|ormask|xormask|shiftleft|shiftright] [n] [path/to/input.pam] > [path/to/output.pam]`


title: TLDR
content:
<b>Open a file with the associated application</b>`open [path/to/file.ext]`<br><b>Open all the files of a given extension in the current directory with the associated application</b>`open [*.ext]`<br><b>Open a directory using the default file manager</b>`open [path/to/directory]`<br><b>Open a website using the default web browser</b>`open [https://example.com]`<br><b>Open a specific URI using the default application that can handle it</b>`open [tel:123]`


title: TLDR
content:
<b>Connect to the server <dav.example.com>, open the root collection</b>`cadaver [http://dav.example.com/]`<br><b>Connect to a server using a specific port and open a collection</b>`cadaver [http://dav.example.com:8022/path/to/collection/]`<br><b>Connect to a server using SSL</b>`cadaver [https://davs.example.com/]`


title: TLDR
content:
<b>Convert an input image to PBM, PGM, or PPM format irrespective of the input type</b>`anytopnm [path/to/input] > [path/to/output.pnm]`<br><b>Display version</b>`anytopnm [[-v|-version]]`


title: TLDR
content:
<b>Add an API token to the local credential storage (located in $CARGO_HOME/credentials.toml)</b>`cargo login`<br><b>Use the specified registry (registry names can be defined in the configuration - the default is <https://crates.io>)</b>`cargo login --registry [name]`


title: TLDR
content:
<b>Generate the histogram for human reading</b>`ppmhist [[-nom|-nomap]] [path/to/image.ppm]`<br><b>Generate a PPM file of the colormap for the image, with the color histogram as comments</b>`ppmhist [[-m|-map]] [path/to/image.ppm]`<br><b>Display version</b>`ppmhist [[-v|-version]]`


title: TLDR
content:
<b>Convert an SBIG CCDOPS image file to PGM</b>`sbigtopgm [path/to/input_file.sbig] > [path/to/output.pgm]`


title: TLDR
content:
<b>Use a specific version of Node.js in the current PowerShell session</b>`Set-NodeVersion [node_version]`<br><b>Use the latest installed Node.js version 20.x</b>`Set-NodeVersion ^20`<br><b>Set the default Node.js version for the current user (only applies to future PowerShell sessions)</b>`Set-NodeVersion [node_version] -Persist User`<br><b>Set the default Node.js version for all users (must be run as Administrator/root and only applies to future PowerShell sessions)</b>`Set-NodeVersion [node_version] -Persist Machine`


title: TLDR
content:
<b>Rebase the current branch on top of another using a merge commit and only one conflict handling</b>`git psykorebase [upstream_branch]`<br><b>Continue after conflicts have been handled</b>`git psykorebase --continue`<br><b>Specify the branch to rebase</b>`git psykorebase [upstream_branch] [target_branch]`


title: TLDR
content:
<b>Mimic the default output of cmatrix (no unicode, works in a TTY)</b>`unimatrix --no-bold --speed [96] --character-list [o]`<br><b>No bold characters, slowly, with emojis, numbers, and a few symbols</b>`unimatrix --no-bold --speed [50] --character-list [ens]`<br><b>Change the color of characters</b>`unimatrix --color [red|green|blue|white|...]`<br><b>Select character set(s) using letter codes (see unimatrix --help for available character sets)</b>`unimatrix --character-list [character_sets]`<br><b>Change the scrolling speed</b>`unimatrix --speed [number]`


title: TLDR
content:
<b>Convert PPM image to PGM image</b>`ppmtopgm [path/to/file.ppm] > [path/to/file.pgm]`<br><b>Display version</b>`ppmtopgm [[-v|-version]]`


title: TLDR
content:
<b>Create a service for a resource, which will be served from container port to node port</b>`kubectl expose [resource_type] [resource_name] --port [node_port] --target-port [container_port]`<br><b>Create a service for a resource identified by a file</b>`kubectl expose [[-f|--filename]] [path/to/file.yml] --port [node_port] --target-port [container_port]`<br><b>Create a service with a name, to serve to a node port which will be same for container port</b>`kubectl expose [resource_type] [resource_name] --port [node_port] --name [service_name]`


title: TLDR
content:
<b>Commit changes with a generated message</b>`git magic`<br><b>[a]dd untracked files and commit changes with a generated message</b>`git magic -a`<br><b>Commit changes with a custom [m]essage</b>`git magic -m "[custom_commit_message]"`<br><b>[e]dit the commit [m]essage before committing</b>`git magic -em "[custom_commit_message]"`<br><b>Commit changes and [p]ush to remote</b>`git magic -p`<br><b>Commit changes with a [f]orce [p]ush to remote</b>`git magic -fp`


title: TLDR
content:
<b>Convert a PPM image to text as specified by the given template</b>`ppmtoarbtxt [path/to/template] [path/to/image.ppm] > [path/to/output_file.txt]`<br><b>Convert a PPM image to text as specified by the given template, prepend the contents of the specified head template</b>`ppmtoarbtxt [path/to/template] -hd [path/to/head_template] [path/to/image.ppm] > [path/to/output_file.txt]`<br><b>Convert a PPM image to text as specified by the given template, append the contents of the specified tail template</b>`ppmtoarbtxt [path/to/template] -hd [path/to/tail_template] [path/to/image.ppm] > [path/to/output_file.txt]`<br><b>Display version</b>`ppmtoarbtxt [[-v|-version]]`


title: TLDR
content:
<b>Apply a configuration to a resource by file name</b>`kubectl apply [[-f|--filename]] [path/to/file]`<br><b>Apply a configuration to a resource from kustomization.yaml in a directory</b>`kubectl apply [[-k|--kustomize]] [path/to/directory]`<br><b>Apply a configuration to a resource by stdin</b>`[cat pod.json] | kubectl apply [[-f|--filename]] -`<br><b>Edit the latest last-applied-configuration annotations of resources from the default editor</b>`kubectl apply edit-last-applied [[-f|--filename]] [path/to/file]`<br><b>Set the latest last-applied-configuration annotations by setting it to match the contents of a file</b>`kubectl apply set-last-applied [[-f|--filename]] [path/to/file]`<br><b>View the latest last-applied-configuration annotations by type/name or file</b>`kubectl apply view-last-applied [[-f|--filename]] [path/to/file]`


title: TLDR
content:
<b>Convert a WBMP file to a PBM image</b>`wbmptopbm [path/to/input_file.wbpm] > [path/to/output_file.pbm]`


title: TLDR
content:
<b>Create a managed container registry</b>`az acr create [[-n|--name]] [registry_name] [[-g|--resource-group]] [resource_group] --sku [sku]`<br><b>Login to a registry</b>`az acr login [[-n|--name]] [registry_name]`<br><b>Tag a local image for ACR</b>`docker tag [image_name] [registry_name].azurecr.io/[image_name]:[tag]`<br><b>Push an image to a registry</b>`docker push [registry_name].azurecr.io/[image_name]:[tag]`<br><b>Pull an image from a registry</b>`docker pull [registry_name].azurecr.io/[image_name]:[tag]`<br><b>Delete an image from a registry</b>`az acr repository delete [[-n|--name]] [registry_name] --repository [image_name]:[tag]`<br><b>Delete a managed container registry</b>`az acr delete [[-n|--name]] [registry_name] [[-g|--resource-group]] [resource_group] [[-y|--yes]]`<br><b>List images within a registry</b>`az acr repository list [[-n|--name]] [registry_name] --output table`


title: TLDR
content:
<b>Turn a PAM image into an oil painting</b>`pamoil [path/to/input_file.pam] > [path/to/output_file.pam]`<br><b>Consider a neighborhood of n pixels for the "smearing" effect</b>`pamoil -n [n] [path/to/input_file.pam] > [path/to/output_file.pam]`


title: TLDR
content:
<b>Run a doctl databases maintenance-window command with an access token</b>`doctl [[d|databases]] [[mw|maintenance-window]] [command] [[-t|--access-token]] [access_token]`<br><b>Retrieve details about a database cluster's maintenance windows</b>`doctl [[d|databases]] [[mw|maintenance-window]] [[g|get]] [database_id]`<br><b>Update the maintenance window for a database cluster</b>`doctl [[d|databases]] [[mw|maintenance-window]] [[u|update]] [database_id] --day [day_of_the_week] --hour [hour_in_24_hours_format]`


title: TLDR
content:
<b>Uninstall a formula/cask</b>`brew [[rm|uninstall]] [formula|cask]`<br><b>Uninstall a cask and remove all associated files</b>`brew [[rm|uninstall]] --zap [cask]`


title: TLDR
content:
<b>Vendor dependencies and configure cargo to use the vendored sources in the current project</b>`cargo vendor [path/to/directory] > .cargo/config.toml`


title: TLDR
content:
<b>Convert an SBIG ST-4 file to a PGM file</b>`st4topgm [path/to/input_file.st4] > [path/to/output.pgm]`


title: TLDR
content:
<b>Read a PNM image as input and produce a JPEG/JFIF/EXIF image as output</b>`pnmtojpeg [path/to/file.pnm] > [path/to/file.jpg]`<br><b>Display version</b>`pnmtojpeg -version`


title: TLDR
content:
<b>Convert to HTML</b>`gladtex [path/to/input.htex]`<br><b>Save the converted file to a specific [o]utput file</b>`gladtex [path/to/input.htex] -o [path/to/output.html]`<br><b>Save the generated images to a specific [d]irectory</b>`gladtex [path/to/input.htex] -d [path/to/image_output_directory]`<br><b>Set image [r]esolution (in dpi, default is 100)</b>`gladtex [path/to/input.htex] -r [resolution]`<br><b>[k]eep LaTeX files after conversion</b>`gladtex [path/to/input.htex] -k`<br><b>Set [b]ackground and [f]oreground color of the images</b>`gladtex [path/to/input.htex] -b [background_color] -f [foreground_color]`<br><b>Convert Markdown to HTML using pandoc and gladtex</b>`pandoc [[-s|--standalone]] [[-t|--to]] html --gladtex [path/to/input.md] | gladtex -o [path/to/output.html]`


title: TLDR
content:
<b>Convert JPEG/JFIF image to a PPM or PGM image</b>`jpegtopnm [path/to/file.jpg] > [path/to/file.pnm]`<br><b>Display version</b>`jpegtopnm [[-v|-version]]`


title: TLDR
content:
<b>Create a resource using the resource definition file</b>`kubectl create [[-f|--filename]] [path/to/file.yml]`<br><b>Create a resource from stdin</b>`kubectl create [[-f|--filename]] -`<br><b>Create a deployment</b>`kubectl create [[deploy|deployment]] [deployment_name] --image [image]`<br><b>Create a deployment with replicas</b>`kubectl create [[deploy|deployment]] [deployment_name] --image [image] --replicas [number_of_replicas]`<br><b>Create a service</b>`kubectl create [[svc|service]] [service_type] [service_name] --tcp [port]:[target_port]`<br><b>Create a namespace</b>`kubectl create [[ns|namespace]] [namespace_name]`


title: TLDR
content:
<b>Convert a PPM image to a PCX file</b>`ppmtopcx [path/to/file.ppm] > [path/to/file.pcx]`<br><b>Produce a PCX file with the specified color depth</b>`ppmtopcx -[8bit|24bit] [path/to/file.ppm] > [path/to/file.pcx]`


title: TLDR
content:
<b>Enable telemetry uploading</b>`gotelemetry on`<br><b>Disable telemetry uploading</b>`gotelemetry off`<br><b>Run a Web Viewer for local telemetry data</b>`gotelemetry view`<br><b>Print the current telemetry environment</b>`gotelemetry env`<br><b>Display help for a specific subcommand</b>`gotelemetry help [subcommand]`


title: TLDR
content:
<b>Run a doctl databases firewalls command with an access token</b>`doctl [[d|databases]] [[fw|firewalls]] [command] [[-t|--access-token]] [access_token]`<br><b>Retrieve a list of firewall rules for a given database</b>`doctl [[d|databases]] [[fw|firewalls]] [[ls|list]]`<br><b>Add a database firewall rule to a given database</b>`doctl [[d|databases]] [[fw|firewalls]] [[a|append]] [database_id] --rule [droplet|k8s|ip_addr|tag|app]:[value]`<br><b>Remove a firewall rule for a given database</b>`doctl [[d|databases]] [[fw|firewalls]] [[rm|remove]] [database_id] [rule_uuid]`


title: TLDR
content:
<b>Compare two tree objects</b>`git diff-tree [tree-ish1] [tree-ish2]`<br><b>Show changes between two specific commits</b>`git diff-tree -r [commit1] [commit2]`<br><b>Display changes in patch format</b>`git diff-tree [[-p|--patch]] [tree-ish1] [tree-ish2]`<br><b>Filter changes by a specific path</b>`git diff-tree [tree-ish1] [tree-ish2] -- [path/to/file_or_directory]`


title: TLDR
content:
<b>Generate a transition between two PPM images ([f]irst and [l]ast) using the specified effect</b>`ppmfade -f [path/to/image1.ppm] -l [path/to/image2.ppm] -[mix|spread|shift|relief|oil|...]`<br><b>Generate a transition starting with the specified image and ending in a solid black image</b>`ppmfade -f [path/to/image.ppm] -[mix|spread|shift|relief|oil|...]`<br><b>Generate a transition starting with a solid black image and ending with the specified image</b>`ppmfade -l [path/to/image.ppm] -[mix|spread|shift|relief|oil|...]`<br><b>Store the resulting images in files named base.NNNN.ppm where NNNN is a increasing number</b>`ppmfade -f [path/to/image1.ppm] -l [path/to/image2.ppm] -[mix|spread|shift|relief|oil|...] -base [base]`


title: TLDR
content:
<b>Convert an input image to PPM format</b>`imgtoppm [path/to/input] > [path/to/output.ppm]`<br><b>Display version</b>`imgtoppm [[-v|-version]]`


title: TLDR
content:
<b>Convert a PAM image file to an ICO file</b>`pamtowinicon [path/to/input_file.pam] > [path/to/output.ico]`<br><b>Encode images with resolutions smaller than t in the BMP format and all other images in the PNG format</b>`pamtowinicon [[-pn|-pngthreshold]] [t] [path/to/input_file.pam] > [path/to/output.ico]`<br><b>Make all pixels outside the non-opaque area black</b>`pamtowinicon [[-t|-truetransparent]] [path/to/input_file.pam] > [path/to/output.ico]`


title: TLDR
content:
<b>Convert an RLE image to a PNM file</b>`rletopnm [path/to/input.rle] > [path/to/output.pnm]`<br><b>Create a PGM image containing the RLE file's alpha channel</b>`rletopnm [[--a|--alphaout]] [path/to/alpha_file.pgm] [path/to/input.rle] > [path/to/output.pnm]`<br><b>Operate in verbose mode and print the contents of the RLE header to stdout</b>`rletopnm [[--verb|--verbose]] [path/to/input.rle] > [path/to/output.pnm]`


title: TLDR
content:
<b>Show the name of the currently active branch</b>`hub branch`<br><b>Create a new branch</b>`hub branch [branch_name]`


title: TLDR
content:
<b>Convert an XBM image to a PPM image</b>`xbmtopbm [path/to/input_file.xbm] > [path/to/output_file.pbm]`


title: TLDR
content:
<b>Print the workspace members and resolved dependencies of the current package</b>`cargo metadata`<br><b>Print only the workspace members and do not fetch dependencies</b>`cargo metadata --no-deps`<br><b>Print metadata in a specific format based on the specified version</b>`cargo metadata --format-version [version]`<br><b>Print metadata with the resolve field including dependencies only for the given target triple (Note: The packages array will still include the dependencies for all targets)</b>`cargo metadata --filter-platform [target_triple]`


title: TLDR
content:
<b>Invite the given user or team as an owner</b>`cargo owner [[-a|--add]] [username|github:org_name:team_name] [crate]`<br><b>Remove the given user or team as an owner</b>`cargo owner [[-r|--remove]] [username|github:org_name:team_name] [crate]`<br><b>List owners of a crate</b>`cargo owner [[-l|--list]] [crate]`<br><b>Use the specified registry (registry names can be defined in the configuration - the default is <https://crates.io>)</b>`cargo owner --registry [name]`


title: TLDR
content:
<b>Run the project in the current directory</b>`dotnet run`<br><b>Run a specific project</b>`dotnet run --project [path/to/file.csproj]`<br><b>Run the project with specific arguments</b>`dotnet run -- [arg1=foo arg2=bar ...]`<br><b>Run the project using a target framework moniker</b>`dotnet run [[-f|--framework]] [net7.0]`<br><b>Specify architecture and OS, available since .NET 6 (Don't use --runtime with these options)</b>`dotnet run [[-a|--arch]] [x86|x64|arm|arm64] --os [win|win7|osx|linux|ios|android]`


title: TLDR
content:
<b>Convert a PPM file to an Atari Spectrum 512 image</b>`ppmtospu [path/to/input.ppm] > [path/to/output.spu]`<br><b>Use a dithering matrix of the specified size (0 means no dithering)</b>`ppmtospu -d[0|2|4] [path/to/input.ppm] > [path/to/output.spu]`


title: TLDR
content:
<b>Perform checks, create a .crate file and upload it to the registry</b>`cargo publish`<br><b>Perform checks, create a .crate file but don't upload it (equivalent of cargo package)</b>`cargo publish [[-n|--dry-run]]`<br><b>Use the specified registry (registry names can be defined in the configuration - the default is <https://crates.io>)</b>`cargo publish --registry [name]`


title: TLDR
content:
<b>Start GUI</b>`telegram-desktop`<br><b>Run GUI as an autostart if allowed</b>`telegram-desktop -autostart`<br><b>Run GUI minimized to tray</b>`telegram-desktop -startintray`


title: TLDR
content:
<b>Convert a Zeiss cofocal file into either .pgm or .ppm format</b>`zeisstopnm [path/to/file]`<br><b>Convert a Zeiss cofocal file to Netbpm format while explicitly specifying the target file type</b>`zeisstopnm -[pgm|ppm] [path/to/file]`


title: TLDR
content:
<b>List API Management services within a resource group</b>`az apim list [[-g|--resource-group]] [resource_group]`<br><b>Create an API Management service instance</b>`az apim create [[-n|--name]] [name] [[-g|--resource-group]] [resource_group] --publisher-email [email] --publisher-name [name]`<br><b>Delete an API Management service</b>`az apim delete [[-n|--name]] [name] [[-g|--resource-group]] [resource_group]`<br><b>Show details of an API Management service instance</b>`az apim show [[-n|--name]] [name] [[-g|--resource-group]] [resource_group]`<br><b>Update an API Management service instance</b>`az apim update [[-n|--name]] [name] [[-g|--resource-group]] [resource_group]`


title: TLDR
content:
<b>Create a blank bitmap of the specified dimensions</b>`pbmmake [width] [height] > [path/to/output_file.pbm]`<br><b>Specify the color of the created bitmap</b>`pbmmake -[white|black|grey] [width] [height] > [path/to/output_file.pbm]`


title: TLDR
content:
<b>Convert a PAM image to a TIFF image</b>`pamtotiff [path/to/input_file.pam] > [path/to/output_file.tiff]`<br><b>Explicitly specify a compression method for the output file</b>`pamtotiff -[none|packbits|lzw|g3|g4|flate|adobeflate] [path/to/input_file.pam] > [path/to/output_file.tiff]`<br><b>Always produce a color TIFF image, even if the input image is greyscale</b>`pamtotiff [[-c|-color]] [path/to/input_file.pam] > [path/to/output_file.tiff]`


title: TLDR
content:
<b>Convert an ILBM file to a PPM image</b>`ilbmtoppm [path/to/file.ilbm] > [path/to/file.ppm]`<br><b>Use the specified color to "show through" where the image is transparent</b>`ilbmtoppm [[-t|-transparent]] [color] [path/to/file.ilbm] > [path/to/file.ppm]`<br><b>Ignore the chunk with the specified chunk ID</b>`ilbmtoppm [[-ig|-ignore]] [chunkID] [path/to/file.ilbm] > [path/to/file.ppm]`<br><b>Store the input's transparency information to the specified PBM file</b>`ilbmtoppm [[-m|-maskfile]] [path/to/maskfile.pbm] [path/to/file.ilbm] > [path/to/file.ppm]`


title: TLDR
content:
<b>Convert PNM files to an HP LaserJet PCL XL printer stream</b>`pnmtopclxl [path/to/input1.pnm path/to/input2.pnm ...] > [path/to/output.pclxl]`<br><b>Specify the resolution of the image as well as the location of the page from the upper left corner of each image</b>`pnmtopclxl -dpi [resolution] [[-x|-xoffs]] [x_offset] [[-y|-yoffs]] [y_offset] [path/to/input1.pnm path/to/input2.pnm ...] > [path/to/output.pclxl]`<br><b>Generate a duplex printer stream for the specified paper format</b>`pnmtopclxl [[-du|-duplex]] [vertical|horizontal] [[-fo|-format]] [letter|legal|a3|a4|a5|...] [path/to/input1.pnm path/to/input2.pnm ...] > [path/to/output.pclxl]`


title: TLDR
content:
<b>Interactively create a new D project</b>`dub init [project_name]`<br><b>Non-interactively create a new D project</b>`dub init [project_name] [[-n|--non-interactive]]`<br><b>Build and run a D project</b>`dub`<br><b>Install dependencies specified in a D project's dub.json or dub.sdl file</b>`dub fetch`<br><b>Update the dependencies in a D project</b>`dub upgrade`<br><b>Display help</b>`dub [[-h|--help]]`


title: TLDR
content:
<b>Generate a PBM file as output for a Xerox doodle brush file as input</b>`brushtopbm [path/to/file.brush]`<br><b>Display version</b>`brushtopbm [[-v|-version]]`


title: TLDR
content:
<b>Open the homepage of the current repository in the default web browser</b>`hub browse`<br><b>Open the homepage of a specific repository in the default web browser</b>`hub browse [owner]/[repository]`<br><b>Open the subpage of a specific repository in the default web browser, subpage can be "wiki", "commits", "issues", or other (default: "tree")</b>`hub browse [owner]/[repository] [subpage]`


title: TLDR
content:
<b>Convert a PBM image to a X11 XBM file</b>`pbmtoxbm [path/to/input_file.pbm] > [path/to/output_file.xbm]`<br><b>Explicitly specify whether an X11 or X10 bitmap should be generated</b>`pbmtoxbm -[x11|x10] [path/to/input_file.pbm] > [path/to/output_file.xbm]`


title: TLDR
content:
<b>Convert an SLD file to a PPM image</b>`sldtoppm [path/to/input.sld] > [path/to/output.ppm]`<br><b>Compensate for non-square pixels by scaling the width of the image</b>`sldtoppm [[-a|-adjust]] [path/to/input.sld] > [path/to/output.ppm]`


title: TLDR
content:
<b>Start a REPL (interactive shell) using a specific Scala and JVM version</b>`scala-cli --scala [3.1.0] --jvm [temurin:17]`<br><b>Compile and run a Scala script</b>`scala-cli run [path/to/script.scala]`<br><b>Compile and test a Scala script</b>`scala-cli test [path/to/script.scala]`<br><b>Format a Scala script, updating the file in-place</b>`scala-cli fmt [path/to/script.scala]`<br><b>Generate files for IDE (VSCode and IntelliJ) support</b>`scala-cli setup-ide [path/to/script.scala]`


title: TLDR
content:
<b>Convert a HIPS file into a PGM image</b>`hipstopgm [path/to/file.hips]`<br><b>Suppress all informational messages</b>`hipstopgm [[-q|-quiet]]`<br><b>Display version</b>`hipstopgm [[-v|-version]]`


title: TLDR
content:
<b>Convert a PPM image to DEC sixel format</b>`ppmtosixel [path/to/file.ppm] > [path/to/file.sixel]`<br><b>Produce an uncompressed SIXEL file that is much slower to print</b>`ppmtosixel [[-r|-raw]] [path/to/file.ppm] > [path/to/file.sixel]`<br><b>Add a left margin of 1.5 inches</b>`ppmtosixel [[-m|-margin]] [path/to/file.ppm] > [path/to/file.sixel]`<br><b>Encode control codes in a more portable (although less space-efficient) way</b>`ppmtosixel -7bit [path/to/file.ppm] > [path/to/file.sixel]`


title: TLDR
content:
<b>Print the fully qualified package specification for the current project</b>`cargo pkgid`<br><b>Print the fully qualified package specification for the specified package</b>`cargo pkgid [partial_pkgspec]`


title: TLDR
content:
<b>Blend the specified PPM images using fadefactor to control the weight of each image</b>`ppmmix [fadefactor] [path/to/input_file1.ppm path/to/input_file2.ppm ...] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Produce a mask of areas of a certain color in the specified PPM image</b>`ppmcolormask [[-c|-color]] [red,blue] [path/to/input.ppm] > [path/to/output.pbm]`


title: TLDR
content:
<b>Add simulated shadows to a PPM image</b>`ppmshadow [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>[b]lur the image by the specified number of pixels</b>`ppmshadow -b [n] [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>Specify the displacement of the simulated light source to the left and the top of the image</b>`ppmshadow -x [left_offset] -y [top_offset] [path/to/input_file.ppm] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Print environment information</b>`accelerate env`<br><b>Interactively create a configuration file</b>`accelerate config`<br><b>Print the estimated GPU memory cost of running a Hugging Face model with different data types</b>`accelerate estimate-memory [name/model]`<br><b>Test an Accelerate configuration file</b>`accelerate test --config_file [path/to/config.yaml]`<br><b>Run a model on CPU with Accelerate</b>`accelerate launch [path/to/script.py] [--cpu]`<br><b>Run a model on multi-GPU with Accelerate, with 2 machines</b>`accelerate launch [path/to/script.py] --multi_gpu --num_machines 2`


title: TLDR
content:
<b>Fork a GitHub repository by its slug</b>`hub fork [tldr-pages/tldr]`<br><b>Fork a GitHub repository by its URL</b>`hub fork [https://github.com/tldr-pages/tldr]`<br><b>Fork current GitHub repository, set remote name to origin</b>`hub fork --remote-name [origin]`


title: TLDR
content:
<b>Create a virtual environment</b>`vf new [virtualenv_name]`<br><b>Create a virtual environment for a specific Python version</b>`vf new --python [/usr/local/bin/python3.8] [virtualenv_name]`<br><b>Activate and use the specified virtual environment</b>`vf activate [virtualenv_name]`<br><b>Connect the current virtualenv to the current directory, so that it is activated automatically as soon as you enter it (and deactivated as soon as you leave)</b>`vf connect`<br><b>Deactivate the current virtual environment</b>`vf deactivate`<br><b>List all virtual environments</b>`vf ls`<br><b>Remove a virtual environment</b>`vf rm [virtualenv_name]`<br><b>Display help</b>`vf help`


title: TLDR
content:
<b>Run the default binary target</b>`cargo [[r|run]]`<br><b>Run the specified binary</b>`cargo [[r|run]] --bin [name]`<br><b>Run the specified example</b>`cargo [[r|run]] --example [name]`<br><b>Activate a space or comma separated list of features</b>`cargo [[r|run]] [[-F|--features]] "[feature1 feature2 ...]"`<br><b>Disable the default features</b>`cargo [[r|run]] --no-default-features`<br><b>Activate all available features</b>`cargo [[r|run]] --all-features`<br><b>Run with the given profile</b>`cargo [[r|run]] --profile [name]`


title: TLDR
content:
<b>Extract an archive</b>`unp [path/to/archive.zip]`<br><b>Extract multiple archives</b>`unp [path/to/archive1.tar.gz] [path/to/archive2.rar]`


title: TLDR
content:
<b>Convert an XV thumbnail image file to PPM</b>`xvminitoppm [path/to/input_file] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Describe the specified Netpbm files</b>`pamfile [path/to/file1 path/to/file2 ...]`<br><b>Describe every image in each input file (as opposed to only the first image in each file) in a machine-readable format</b>`pamfile [[-a|-allimages]] -machine [path/to/file]`<br><b>Display a count on how many images the input files contain</b>`pamfile [[-cou|-count]] [path/to/file]`


title: TLDR
content:
<b>Remove all unused formulae</b>`brew autoremove`<br><b>Print what would be removed, but don't actually remove anything</b>`brew autoremove [[-n|--dry-run]]`


title: TLDR
content:
<b>Convert a PNM image to a CMYK encoded TIFF</b>`pnmtotiffcmyk [path/to/input_file.pnm] > [path/to/output_file.tiff]`<br><b>Specify the TIFF compression method</b>`pnmtotiffcmyk -[none|packbits|lzw] [path/to/input_file.pnm] > [path/to/output_file.tiff]`<br><b>Control the fill order</b>`pnmtotiffcmyk -[msb2lsb|lsb2msb] [path/to/input_file.pnm] > [path/to/output_file.tiff]`


title: TLDR
content:
<b>Run a doctl databases command with an access token</b>`doctl [[d|databases]] [command] [[-t|--access-token]] [access_token]`<br><b>Get details for a database cluster</b>`doctl [[d|databases]] [[g|get]]`<br><b>List your database clusters</b>`doctl [[d|databases]] [[ls|list]]`<br><b>Create a database cluster</b>`doctl [[d|databases]] [[c|create]] [database_name]`<br><b>Delete a cluster</b>`doctl [[d|databases]] [[rm|delete]] [database_id]`


title: TLDR
content:
<b>Convert a PGM image file to the SBIG ST-4 format</b>`pgmtost4 [path/to/input_file.pgm] > [path/to/output.st4]`


title: TLDR
content:
<b>Dim the specified PPM image by dimfactor</b>`ppmdim [0.6] [path/to/input.ppm] > [path/to/output.ppm]`


title: TLDR
content:
<b>Run a doctl databases user command with an access token</b>`doctl [[d|databases]] [[u|user]] [command] [[-t|--access-token]] [access_token]`<br><b>Retrieve details about a database user</b>`doctl [[d|databases]] [[u|user]] [[g|get]] [database_id] [user_name]`<br><b>Retrieve a list of database users for a given database</b>`doctl [[d|databases]] [[u|user]] [[ls|list]] [database_id]`<br><b>Reset the auth password for a given user</b>`doctl [[d|databases]] [[u|user]] [[rs|reset]] [database id] [user_name]`<br><b>Reset the MySQL auth plugn for a given user</b>`doctl [[d|databases]] [[u|user]] [[rs|reset]] [database_id] [user_name] [caching_sha2_password|mysql_native_password]`<br><b>Create a user in the given database with a given username</b>`doctl [[d|databases]] [[u|user]] [[c|create]] [database_id] [user_name]`<br><b>Delete a user from the given database with the given username</b>`doctl [[d|databases]] [[u|user]] [[rm|delete]] [database_id] [user_name]`


title: TLDR
content:
<b>Delete all branches that were "squash-merged" into the current checked out branch</b>`git delete-squashed-branches`<br><b>Delete all branches that were "squash-merged" into a specific branch</b>`git delete-squashed-branches [branch_name]`


title: TLDR
content:
<b>Convert a PPM image to a ICR file</b>`ppmtoicr [path/to/file.ppm] > [path/to/file.icr]`<br><b>Display the output in name</b>`ppmtoicr [[-w|-windowname]] [name] [path/to/file.ppm] > [path/to/file.icr]`<br><b>Expand the image by the specified factor</b>`ppmtoicr [[-e|-expand]] [factor] [path/to/file.ppm] > [path/to/file.icr]`<br><b>Display the output on the screen with the specified number</b>`ppmtoicr [[-d|-display]] [number] [path/to/file.ppm] > [path/to/file.icr]`


title: TLDR
content:
<b>List all installed formulae and casks</b>`brew [[ls|list]]`<br><b>List files belonging to an installed formula</b>`brew [[ls|list]] [formula]`<br><b>List artifacts of a cask</b>`brew [[ls|list]] [cask]`<br><b>List only formulae</b>`brew [[ls|list]] --formula`<br><b>List only casks</b>`brew [[ls|list]] --cask`<br><b>List only pinned formulae</b>`brew [[ls|list]] --pinned`


title: TLDR
content:
<b>Convert a PPM image to an X11 puzzle file</b>`ppmtopuzz [path/to/file.ppm] > [path/to/file.puzz]`


title: TLDR
content:
<b>Inspect the changes to a container since it was created</b>`docker diff [container]`<br><b>Display help</b>`docker diff --help`


title: TLDR
content:
<b>Convert a TIFF to a PNM file</b>`tifftopnm [path/to/input_file.tiff] > [path/to/output_file.pnm]`<br><b>Create a PGM file containing the alpha channel of the input image</b>`tifftopnm [[-a|-alphaout]] [path/to/alpha_file.pgm] [path/to/input_file.tiff] > [path/to/output_file.pnm]`<br><b>Respect the fillorder tag in the input TIFF image</b>`tifftopnm [[-r|-respectfillorder]] [path/to/input_file.tiff] > [path/to/output_file.pnm]`<br><b>Print TIFF header information to stderr</b>`tifftopnm [[-h|-headerdump]] [path/to/input_file.tiff] > [path/to/output_file.pnm]`


title: TLDR
content:
<b>Shift the lines in the input image by a randomized amount not exceeding s to the left or to the right</b>`ppmshift [s] [path/to/input_file.ppm] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Read ASCII data as input and produce a PGM image with pixel values that are an approximation of the "brightness" of the ASCII characters</b>`asciitopgm [path/to/input_file] > [path/to/output_file.pgm]`<br><b>Display version</b>`asciitopgm [[-v|-version]]`


title: TLDR
content:
<b>Produce a PPM file of the specified pattern with the specified dimensions</b>`ppmpat -[gingham2|gingham3|madras|tartan|poles|...] [width] [height] > [path/to/file.ppm]`<br><b>Produce a PPM file of a camo pattern using the specified colors</b>`ppmpat [[-ca|-camo]] [[-co|-color]] [color1,color2,...] [width] [height] > [path/to/file.ppm]`


title: TLDR
content:
<b>Scale a replica set</b>`kubectl scale --replicas [replicas_count] rs/[replica_name]`<br><b>Scale a resource identified by a file</b>`kubectl scale --replicas [replicas_count] [[-f|--filename]] [path/to/file.yml]`<br><b>Scale a deployment based on current number of replicas</b>`kubectl scale --replicas [replicas_count] --current-replicas [current_replicas] [[deploy|deployment]]/[deployment_name]`


title: TLDR
content:
<b>Create PGM image with a uniform gray level (specified as a number between 0 and 1) and the specified dimensions</b>`pgmmake [graylevel] [width] [height] > [path/to/output_file.pgm]`


title: TLDR
content:
<b>Convert a PPM image to a XPM image</b>`ppmtoxpm [path/to/input_file.ppm] > [path/to/output_file.xpm]`<br><b>Specify the prefix string in the output XPM image</b>`ppmtoxpm [[-n|-name]] [prefix_string] [path/to/input_file.ppm] > [path/to/output_file.xpm]`<br><b>In the output XPM file, specify colors by their hexadecimal code instead of their name</b>`ppmtoxpm [[-h|-hexonly]] [path/to/input_file.ppm] > [path/to/output_file.xpm]`<br><b>Use the specified PGM file as a transparency mask</b>`ppmtoxpm [[-a|-alphamask]] [path/to/alpha_file.pgm] [path/to/input_file.ppm] > [path/to/output_file.xpm]`


title: TLDR
content:
<b>Run a doctl databases sql-mode command with an access token</b>`doctl [[d|databases]] [[sm|sql-mode]] [command] [[-t|--access-token]] [access_token]`<br><b>Get a MySQL database cluster's SQL modes</b>`doctl [[d|databases]] [[sm|sql-mode]] [[g|get]] [database_id]`<br><b>Overwrite a MySQL database cluster's SQL modes to the specified modes</b>`doctl [[d|databases]] [[sm|sql-mode]] [[s|set]] [database_id] [sql_mode_1 sql_mode_2 ...]`


title: TLDR
content:
<b>Apply the Bentley Effect on a PGM image</b>`pgmbentley [path/to/input_file.pgm] > [path/to/output_file.pgm]`


title: TLDR
content:
<b>List the last 10 issues with the bug label</b>`hub issue list [[-L|--limit]] [10] [[-l|--labels]] "[bug]"`<br><b>Display a specific issue</b>`hub issue show [issue_number]`<br><b>List 10 closed issues assigneed to a specific user</b>`hub issue [[-s|--state]] [closed] [[-a|--assignee]] [username] --limit [10]`


title: TLDR
content:
<b>Read a PPM image from the input file, convert it to a Berkeley YUV image and store it in the specified output file</b>`ppmtoeyuv [path/to/input_file.ppm] > [path/to/output_file.eyuv]`


title: TLDR
content:
<b>Convert an SGI image to a PNM file</b>`sgitopnm [path/to/input.sgi] > [path/to/output.pnm]`<br><b>Display information about the SGI file</b>`sgitopnm [[-verb|-verbose]] [path/to/input.sgi] > [path/to/output.pnm]`<br><b>Extract channel n of the SGI file</b>`sgitopnm [[-c|-channel]] [n] [path/to/input.sgi] > [path/to/output.pnm]`


title: TLDR
content:
<b>Add text to a PPM image at the specified location</b>`ppmlabel -x [pos_x] -y [pos_y] [[-t|-text]] [text] [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>Add multiple texts at different locations</b>`ppmlabel -x [pos_x1] -y [pos_y1] [[-t|-text]] [text1] -x [pos_x2] -y [pos_y2] [[-t|-text]] [text2] [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>Specify the line color, the background color, the tilt and the size of the added text</b>`ppmlabel -x [pos_x] -y [pos_y] [[-c|-color]] [line_color] [[-b|-background]] [background_color] [[-a|-angle]] [tilt] [[-s|-size]] [size] [[-t|-text]] [text] [path/to/input_file.ppm] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Convert a XWD image file to PBM</b>`xwdtopnm [path/to/input_file.xwd] > [path/to/output_file.pnm]`<br><b>Display information about the conversion process</b>`xwdtopnm [[-verb|-verbose]] [path/to/input_file.xwd] > [path/to/output_file.pnm]`<br><b>Display the contents of the X11 header of the input file</b>`xwdtopnm [[-h|-headerdump]] [path/to/input_file.xwd] > [path/to/output_file.pnm]`


title: TLDR
content:
<b>Change the Node.js install location to a specified directory (ps-nvm will create a new .nvm subdirectory to install them)</b>`Set-NodeInstallLocation [path/to/directory]`


title: TLDR
content:
<b>Label a pod</b>`kubectl label [[po|pods]] [pod_name] [key]=[value]`<br><b>Update a pod label by overwriting the existing value</b>`kubectl label [[po|pods]] [pod_name] [key]=[value] --overwrite`<br><b>Label all pods in the namespace</b>`kubectl label [[po|pods]] [key]=[value] --all`<br><b>Label a pod identified by the pod definition file</b>`kubectl label [[-f|--filename]] [pod_definition_file] [key]=[value]`<br><b>Remove the label from a pod</b>`kubectl label [[po|pods]] [pod_name] [key]-`


title: TLDR
content:
<b>Produce an MPEG-1 stream using the parameter file to specify inputs and outputs</b>`ppmtompeg [path/to/parameter_file]`<br><b>Encode the GOP with the specified number only</b>`ppmtompeg [[-g|-gop]] [gop_num] [path/to/parameter_file]`<br><b>Specify the first and last frame to encode</b>`ppmtompeg [[-fr|-frames]] [first_frame] [last_frame] [path/to/parameter_file]`<br><b>Combine multiple MPEG frames into a single MPEG-1 stream</b>`ppmtompeg -combine_frames [path/to/parameter_file]`


title: TLDR
content:
<b>Make the RGB colors in a PPM image compatible with NTSC color systems</b>`ppmntsc [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>Make the RGB colors in a PPM image compatible with PAL color systems</b>`ppmntsc --pal [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>Print the number of illegal pixels in the input image to stderr</b>`ppmntsc [[--verb|--verbose]] [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>Output only legal/illegal/corrected pixels, set other pixels to black</b>`ppmntsc --[legalonly|illegalonly|correctedonly] [path/to/input_file.ppm] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Convert a Netpbm image to the QOI format</b>`pamtoqoi [path/to/image.pnm] > [path/to/output.qoi]`


title: TLDR
content:
<b>Convert a YBM image file to PBM</b>`ybmtopbm [path/to/input_file.ybm] > [path/to/output_file.pbm]`


title: TLDR
content:
<b>Generate a PPM image as output that is flashfactor times brighter than the input PPM image</b>`ppmflash [flashfactor] [path/to/file.ppm] > [path/to/file.ppm]`<br><b>Display version</b>`ppmflash [[-v|-version]]`


title: TLDR
content:
<b>Generate documentation from the crate's root</b>`rustdoc [src/lib.rs]`<br><b>Pass a name for the project</b>`rustdoc [src/lib.rs] --crate-name [name]`<br><b>Generate documentation from Markdown files</b>`rustdoc [path/to/file.md]`<br><b>Specify the output directory</b>`rustdoc [src/lib.rs] --out-dir [path/to/output_directory]`


title: TLDR
content:
<b>View documentation for Get-NodeInstallLocation, a tool to get the current Node.js install location</b>`tldr get-nodeinstalllocation`<br><b>View documentation for Get-NodeVersions, a tool to list all available and currently-installed Node.js versions</b>`tldr get-nodeversions`<br><b>View documentation for Install-NodeVersion, a tool to install Node.js runtime versions</b>`tldr install-nodeversion`<br><b>View documentation for Remove-NodeVersion, a tool to uninstall an existing Node.js version</b>`tldr remove-nodeversion`<br><b>View documentation for Set-NodeInstallLocation, a tool to set the Node.js install location</b>`tldr set-nodeinstalllocation`<br><b>View documentation for Set-NodeVersion, a tool to set the default version of Node.js</b>`tldr set-nodeversion`


title: TLDR
content:
<b>Display the JSON object with full path to the Cargo.toml manifest</b>`cargo locate-project`<br><b>Display the project path in the specified format</b>`cargo locate-project --message-format [plain|json]`<br><b>Display the Cargo.toml manifest located at the root of the workspace as opposed to the current workspace member</b>`cargo locate-project --workspace`<br><b>Display the Cargo.toml manifest of a specific directory</b>`cargo locate-project --manifest-path [path/to/Cargo.toml]`


title: TLDR
content:
<b>Build a D source file</b>`dmd [path/to/source.d]`<br><b>Generate code for all template instantiations</b>`dmd -allinst`<br><b>Control bounds checking</b>`dmd -boundscheck=[on|safeonly|off]`<br><b>List information on all available checks</b>`dmd -check=[h|help|?]`<br><b>Turn on colored console output</b>`dmd -color`


title: TLDR
content:
<b>Uninstall a given Node.js version</b>`Remove-NodeVersion [node_version]`<br><b>Uninstall multiple Node.js versions</b>`Remove-NodeVersion [node_version1 , node_version2 , ...]`<br><b>Uninstall all currently-installed versions of Node.js 20.x</b>`Get-NodeVersions -Filter ">=20.0.0 <21.0.0" | Remove-NodeVersion`<br><b>Uninstall all currently-installed versions of Node.js</b>`Get-NodeVersions | Remove-NodeVersion`


title: TLDR
content:
<b>Convert a raw greyscale image to a PGM image</b>`rawtopgm [width] [height] [path/to/image.raw] > [path/to/output.pgm]`<br><b>Convert a raw greyscale image to a PGM image, assume the image to be a square</b>`rawtopgm [path/to/image.raw] > [path/to/output.pgm]`<br><b>Convert a raw greyscale image in which the pixels come bottom-first instead of top-first to a PGM image</b>`rawtopgm [width] [height] [[-bt|-bottomfirst]] [path/to/image.raw] > [path/to/output.pgm]`<br><b>Ignore the first n bytes of the specified file</b>`rawtopgm [width] [height] [[-h|-headerskip]] [n] [path/to/image.raw] > [path/to/output.pgm]`<br><b>Ignore the last m bytes of each row in the specified file</b>`rawtopgm [width] [height] [[-r|-rowskip]] [m] [path/to/image.raw] > [path/to/output.pgm]`<br><b>Specify the maxval for the grey values in the input to be equal to n</b>`rawtopgm [width] [height] [[-m|-maxval]] [n] [path/to/image.raw] > [path/to/output.pgm]`<br><b>Specify the number of bytes that represent each sample in the input and that the byte-sequence is to be interpreted as little-endian</b>`rawtopgm [width] [height] -bpp [1|2] [[-l|-littleendian]] [path/to/image.raw] > [path/to/output.pgm]`


title: TLDR
content:
<b>View documentation for the command available in macOS</b>`tldr open [[-p|--platform]] osx`<br><b>View documentation for the command available through fish</b>`tldr open.fish`


title: TLDR
content:
<b>Apply the Rules of Life to an input PBM image file for one generation and the output the result as a PBM image file</b>`pbmlife [path/to/file.pbm]`<br><b>Display version</b>`pbmlife [[-v|-version]]`


title: TLDR
content:
<b>Read a Berkeley YUV file from the specified input file, convert it to a PPM image and store it in the specified output file</b>`eyuvtoppm --width [width] --height [height] [path/to/input_file.eyuv] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Compare the working directory with a specific commit</b>`git diff-index [commit]`<br><b>Compare a specific file or directory in working directory with a commit</b>`git diff-index [commit] [path/to/file_or_directory]`<br><b>Compare the working directory with the index (staging area) to check for staged changes</b>`git diff-index --cached [commit]`<br><b>Suppress output and return an exit status to check for differences</b>`git diff-index --quiet [commit]`


title: TLDR
content:
<b>Convert a PCX file to a PPM image</b>`pcxtoppm [path/to/file.pcx] > [path/to/file.ppm]`<br><b>Use a predefined standard palette even if the PCX file provides one</b>`pcxtoppm [[-s|-stdpalette]] [path/to/file.pcx] > [path/to/file.ppm]`<br><b>Print information on the PCX header to stdout</b>`pcxtoppm [[-verb|-verbose]] [path/to/file.pcx] > [path/to/file.ppm]`


title: TLDR
content:
<b>Convert a RAST image to a PNM file</b>`rasttopnm [path/to/input.rast] > [path/to/output.pnm]`<br><b>Use the color map indices in the raster if they are color values</b>`rasttopnm [[-i|-index]] [path/to/input.rast] > [path/to/output.pnm]`


title: TLDR
content:
<b>Convert a GEM image file to a PNM image</b>`gemtopnm [path/to/file.img] > [path/to/output.pnm]`<br><b>Describe the contents of the specified GEM image</b>`gemtopnm [[-d|-debug]] [path/to/file.img]`<br><b>Display version</b>`gemtopnm -version`


title: TLDR
content:
<b>Compile a source code file into an executable binary</b>`ldc2 [path/to/source.d] -of=[path/to/output_executable]`<br><b>Compile the source code file without linking</b>`ldc2 -c [path/to/source.d]`<br><b>Select the target architecture and OS</b>`ldc -mtriple=[architecture_OS] -c [path/to/source.d]`<br><b>Display help</b>`ldc2 -h`<br><b>Display complete help</b>`ldc2 -help-hidden`


title: TLDR
content:
<b>Search for packages</b>`cargo search [query]`<br><b>Show n results (default: 10, max: 100)</b>`cargo search --limit [n] [query]`


title: TLDR
content:
<b>Convert a Netpbm image to a TrueVision Targa file</b>`pamtotga [path/to/file.pam] > [path/to/output.tga]`<br><b>Specify the color map of the output image</b>`pamtotga -[cmap|cmap16|mono|rgb] [path/to/file.pam] > [path/to/output.tga]`<br><b>Display version</b>`pamtotga [[-v|-version]]`


title: TLDR
content:
<b>Convert an XIM image to a PPM image</b>`ximtoppm [path/to/input_file.xim] > [path/to/output_file.ppm]`<br><b>Store the transparency mask of the input image in the specified file</b>`ximtoppm [[-a|-alphaout]] [path/to/alpha_file.pbm] [path/to/input_file.xim] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Search for casks and formulae using a keyword</b>`brew search [keyword]`<br><b>Search for casks and formulae using a regex</b>`brew search /[regex]/`<br><b>Enable searching through descriptions</b>`brew search --desc [keyword]`<br><b>Only search for formulae</b>`brew search --formula [keyword]`<br><b>Only search for casks</b>`brew search --cask [keyword]`


title: TLDR
content:
<b>Install a formula/cask</b>`brew install [formula|cask]`<br><b>Build and install a formula from source (dependencies will still be installed from bottles)</b>`brew install [[-s|--build-from-source]] [formula]`<br><b>Download the manifest, print what would be installed but don't actually install anything</b>`brew install [[-n|--dry-run]] [formula|cask]`


title: TLDR
content:
<b>Read an ICO file and convert the best quality image contained therein to the PAM format</b>`winicontopam [path/to/input_file.ico] > [path/to/output.pam]`<br><b>Convert all images in the input file to PAM</b>`winicontopam [[-al|-allimages]] [path/to/input_file.ico] > [path/to/output.pam]`<br><b>Convert the n'th image in the input file to PAM</b>`winicontopam [[-i|-image]] [n] [path/to/input_file.ico] > [path/to/output.pam]`<br><b>If the image(s) to be extracted contain graded transparency data and an AND mask, write the AND mask into the fifth channel of the output PAM file</b>`winicontopam [[-an|-andmasks]] [path/to/input_file.ico] > [path/to/output.pam]`


title: TLDR
content:
<b>Give the PPM image an American TV appearance</b>`ppmtv [dim_factor] [path/to/file.ppm] > [path/to/output.ppm]`<br><b>Suppress all informational messages</b>`ppmtv [[-q|-quiet]]`<br><b>Display version</b>`ppmtv [[-v|-version]]`


title: TLDR
content:
<b>Generate an image of a planet</b>`ppmforge > [path/to/image.ppm]`<br><b>Generate an image of clouds or the night sky</b>`ppmforge -[night|clouds] > [path/to/image.ppm]`<br><b>Use a custom mesh size and dimension for fractal generation and specify the dimensions of the output</b>`ppmforge [[-m|-mesh]] [512] [[-d|-dimension]] [2.5] [[-x|-xsize]] [1000] [[-y|-ysize]] [1000] > [path/to/image.ppm]`<br><b>Control the tilt and the angle from which the generated planet is illuminated</b>`ppmforge [[-t|-tilt]] [-15] [[-ho|-hour]] [12] > [path/to/image.ppm]`


title: TLDR
content:
<b>Yank the specified version of a crate</b>`cargo yank [crate]@[version]`<br><b>Undo a yank (i.e. allow downloading it again)</b>`cargo yank --undo [crate]@[version]`<br><b>Use the specified registry (registry names can be defined in the configuration - the default is <https://crates.io>)</b>`cargo yank --registry [name] [crate]@[version]`


title: TLDR
content:
<b>Perform checks and create a .crate file (equivalent of cargo publish --dry-run)</b>`cargo package`<br><b>Display what files would be included in the tarball without actually creating it</b>`cargo package [[-l|--list]]`


title: TLDR
content:
<b>Convert a PAM image to an equivalent PNM image, i.e. a PBM, PGM or PPM image</b>`pamtopnm [path/to/image.pam] > [path/to/output.pbm|pgm|ppm]`<br><b>Display version</b>`pamtopnm [[-v|-version]]`


title: TLDR
content:
<b>Produce a relief of the specified PPM image</b>`ppmrelief [path/to/input_file.ppm] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Copy a PPM image (i.e. a PBM, PGM or PPM image) from stdin to stdout</b>`ppmtoppm < [path/to/image.ppm] > [path/to/output.ppm]`<br><b>Display version</b>`ppmtoppm [[-v|-version]]`


title: TLDR
content:
<b>Fetch dependencies specified in Cargo.lock (for all targets)</b>`cargo fetch`<br><b>Fetch dependencies for the specified target</b>`cargo fetch --target [target_triple]`


title: TLDR
content:
<b>Convert a MacPaint file into a PGM image</b>`macptopbm [path/to/file.macp] > [path/to/output.pbm]`<br><b>Skip over n bytes when reading the file</b>`macptopbm [[-e|-extraskip]] [n] > [path/to/output.pbm]`<br><b>Suppress all informational messages</b>`macptopbm [[-q|-quiet]] > [path/to/output.pbm]`<br><b>Display version</b>`macptopbm [[-v|-version]]`


title: TLDR
content:
<b>Display the running processes of a container</b>`docker top [container]`<br><b>Display help</b>`docker top --help`


title: TLDR
content:
<b>Create a PPM image of the specified color and dimensions</b>`ppmmake [color] [width] [height] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Convert an XPM image to a PPM image</b>`xpmtoppm [path/to/input_file.xpm] > [path/to/output_file.ppm]`<br><b>Store the transparency mask of the input image in the specified file</b>`xpmtoppm [[-a|--alphaout]] [path/to/alpha_file.pbm] [path/to/input_file.xpm] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Convert a PPM file to an HP LaserJet PCL 5 Color file</b>`ppmtolj [path/to/input.ppm] > [path/to/output.lj]`<br><b>Apply a gamma correction using the specified gamma value</b>`ppmtolj [[-g|-gamma]] [gamma] [path/to/input.ppm] > [path/to/output.lj]`<br><b>Specify the required resolution</b>`ppmtolj [[-r|-resolution]] [75|100|150|300|600] [path/to/input.ppm] > [path/to/output.lj]`


title: TLDR
content:
<b>Convert a PPM image to an AutoCAD slide</b>`ppmtoacad [path/to/file.ppm] > [path/to/file.acad]`<br><b>Convert a PPM image to an AutoCAD binary database import file</b>`ppmtoacad [[-d|-dxb]] [path/to/file.ppm] > [path/to/file.dxb]`<br><b>Restrict the colors in the output to 8 RGB shades</b>`ppmtoacad -8 [path/to/file.ppm] > [path/to/file.dxb]`


title: TLDR
content:
<b>Copy specific files from a remote</b>`git rscp [remote_name] [path/to/file1 path/to/file2 ...]`<br><b>Copy a specific directory from a remote</b>`git rscp [remote_name] [path/to/directory]`


title: TLDR
content:
<b>Replace the resource using the resource definition file</b>`kubectl replace [[-f|--filename]] [path/to/file.yml]`<br><b>Replace the resource using the input passed into stdin</b>`kubectl replace [[-f|--filename]] -`<br><b>Force replace, delete and then re-create the resource</b>`kubectl replace [[-f|--filename]] [path/to/file.yml] --force`


title: TLDR
content:
<b>Run a recipe specified in the justfile</b>`just [recipe]`<br><b>Initialize new justfile in project root</b>`just --init`<br><b>Edit justfile in the default editor</b>`just [[-e|--edit]]`<br><b>List available recipes in the justfile</b>`just [[-l|--list]]`<br><b>Print justfile</b>`just --dump`


title: TLDR
content:
<b>Convert a TrueVision Targa file to a PPM image</b>`tgatoppm [path/to/file.tga] > [path/to/output.ppm]`<br><b>Dump information from the TGA header to stdout</b>`tgatoppm [[-h|-headerdump]] [path/to/file.tga] > [path/to/output.ppm]`<br><b>Write the transparency channel values of the input image to the specified file</b>`tgatoppm [[-a|-alphaout]] [path/to/transparency_file.pgm] [path/to/file.tga] > [path/to/output.ppm]`<br><b>Display version</b>`tgatoppm [[-v|-version]]`


title: TLDR
content:
<b>Run a doctl databases options command with an access token</b>`doctl [[d|databases]] [[o|options]] [command] [[-t|--access-token]] [access_token]`<br><b>Retrieve a list of the available database engines</b>`doctl [[d|databases]] [[o|options]] [[eng|engines]]`<br><b>Retrieve a list of the available regions for a given database engine</b>`doctl [[d|databases]] [[o|options]] [[r|regions]] --engine [pg|mysql|redis|mongodb]`<br><b>Retrieve a list of the available slugs for a given database engine</b>`doctl [[d|databases]] [[o|options]] [[s|slugs]] --engine [pg|mysql|redis|mongodb]`<br><b>Retrieve a list of the available versions for a given database engine</b>`doctl [[d|databases]] [[o|options]] [[v|versions]] --engine [pg|mysql|redis|mongodb]`


title: TLDR
content:
<b>Remove grey shadows from a PGM image</b>`pgmdeshadow [path/to/input_file.pgm] > [path/to/output_file.pgm]`


title: TLDR
content:
<b>Convert an image to PDF (Note: Specifying an output filename is optional)</b>`a2ping [path/to/image.ext] [path/to/output.pdf]`<br><b>Compress the document using the specified method</b>`a2ping --nocompress [none|zip|best|flate] [path/to/file]`<br><b>Scan HiResBoundingBox if present (defaults to yes)</b>`a2ping --nohires [path/to/file]`<br><b>Allow page content below and left of the origin (defaults to no)</b>`a2ping --below [path/to/file]`<br><b>Pass extra arguments to gs</b>`a2ping --gsextra [arguments] [path/to/file]`<br><b>Pass extra arguments to external program (i.e pdftops)</b>`a2ping --extra [arguments] [path/to/file]`<br><b>Display help</b>`a2ping [[-h|--help]]`


title: TLDR
content:
<b>List available domains for your AWS account</b>`aws codeartifact list-domains`<br><b>Generate credentials for a specific package manager</b>`aws codeartifact login --tool [npm|pip|twine] --domain [your_domain] --repository [repository_name]`<br><b>Get the endpoint URL of a CodeArtifact repository</b>`aws codeartifact get-repository-endpoint --domain [your_domain] --repository [repository_name] --format [npm|pypi|maven|nuget|generic]`<br><b>Display help</b>`aws codeartifact help`<br><b>Display help for a specific subcommand</b>`aws codeartifact [subcommand] help`


title: TLDR
content:
<b>Show a dependency tree of the current project</b>`cargo tree`<br><b>Only show dependencies up to the specified depth (e.g. when n is 1, display only direct dependencies)</b>`cargo tree --depth [n]`<br><b>Do not display the given package (and its dependencies) in the tree</b>`cargo tree --prune [package_spec]`<br><b>Show all occurrences of repeated dependencies</b>`cargo tree --no-dedupe`<br><b>Only show normal/build/development dependencies</b>`cargo tree [[-e|--edges]] [normal|build|dev]`


title: TLDR
content:
<b>Check the correctness of the current project's manifest</b>`cargo verify-project`<br><b>Check the correctness of the specified manifest file</b>`cargo verify-project --manifest-path [path/to/Cargo.toml]`


title: TLDR
content:
<b>Run a doctl databases db command with an access token</b>`doctl [[d|databases]] db [command] [[-t|--access-token]] [access_token]`<br><b>Retrieve the name of the given database hosted in the given database cluster</b>`doctl [[d|databases]] db [[g|get]] [database_id] [database_name]`<br><b>List existing databases hosted within a given database cluster</b>`doctl [[d|databases]] db [[ls|list]] [database_id]`<br><b>Create a database with the given name in the given database cluster</b>`doctl [[d|databases]] db [[c|create]] [database_id] [database_name]`<br><b>Delete the database with the given name in the given database cluster</b>`doctl [[d|databases]] db [[rm|delete]] [database_id] [database_name]`


title: TLDR
content:
<b>Convert a PBM image file to YBM</b>`pbmtoybm [path/to/input_file.pbm] > [path/to/output_file.ybm]`


title: TLDR
content:
<b>Read Akebas YUV bytes from the specified input file, convert them to a PPM image and store them in the specified output file</b>`yuvtoppm [width] [height] [path/to/input_file.yuv] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Encrypt a file for user and save it to message.age</b>`echo "[Your secret message]" | rage --encrypt --recipient [user] --output [path/to/message.age]`<br><b>Decrypt a file with identity_file and save it to message</b>`rage --decrypt --identity [path/to/identity_file] --output [message]`


title: TLDR
content:
<b>Generate a rainbow consisting of the specified colors</b>`ppmrainbow [color1 color2 ...] > [path/to/output_file.ppm]`<br><b>Specify the size of the output in pixels</b>`ppmrainbow [[-w|-width]] [width] [[-h|-height]] [height] [color1 color2 ...] > [path/to/output_file.ppm]`<br><b>End the rainbow with the last color specified, do not repeat the first color</b>`ppmrainbow [[-n|-norepeat]] [color1 color2 ...] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Convert a PPM image to a MITSU file</b>`ppmtomitsu [path/to/file.ppm] > [path/to/file.mitsu]`<br><b>Enlarge the image by the specified factor, use the specified sharpness and produce n copies</b>`ppmtomitsu [[-e|-enlarge]] [1|2|3] [[-s|-sharpness]] [1|2|3|4] [[-c|-copy]] [n] [path/to/file.ppm] > [path/to/file.mitsu]`<br><b>Use the given medium for the printing process</b>`ppmtomitsu [[-m|-media]] [A|A4|AS|A4S] [path/to/file.ppm] > [path/to/file.mitsu]`


title: TLDR
content:
<b>Add a reference to the project in the current directory</b>`dotnet add reference [path/to/reference.csproj]`<br><b>Add multiple references to the project in the current directory</b>`dotnet add reference [path/to/reference1.csproj path/to/reference2.csproj ...]`<br><b>Add a reference to the specific project</b>`dotnet add [path/to/project.csproj] reference [path/to/reference.csproj]`<br><b>Add multiple references to the specific project</b>`dotnet add [path/to/project.csproj] reference [path/to/reference1.csproj path/to/reference2.csproj ...]`


title: TLDR
content:
<b>Convert a PPM image to a BMP file</b>`ppmtobmp [path/to/file.ppm] > [path/to/file.bmp]`<br><b>Explicitly specify whether or not a Windows BMP file or an OS/2 BMP file should be created</b>`ppmtobmp -[windows|os2] [path/to/file.ppm] > [path/to/file.bmp]`<br><b>Use a specific number of bits for each pixel</b>`ppmtobmp [[-b|-bbp]] [1|4|8|24] [path/to/file.ppm] > [path/to/file.bmp]`


title: TLDR
content:
<b>Create an executable</b>`gdc [path/to/source.d] -o [path/to/output_executable]`<br><b>Print information about module dependencies</b>`gdc -fdeps`<br><b>Generate Ddoc documentation</b>`gdc -fdoc`<br><b>Generate D interface files</b>`gdc -fintfc`<br><b>Do not link the standard GCC libraries in the compilation</b>`gdc -nostdlib`


title: TLDR
content:
<b>Convert a PNM image to a RAST image</b>`pnmtorast [path/to/input.pnm] > [path/to/output.rast]`<br><b>Force either RT_STANDARD or RT_BYTE_ENCODED form for the output</b>`pnmtorast -[standard|rle] [path/to/input.pnm] > [path/to/output.rast]`


title: TLDR
content:
<b>Convert a PS file to PNM images, storing page N of the input to path/to/fileN.ppm</b>`pstopnm [path/to/file.ps]`<br><b>Explicitly specify the output format</b>`pstopnm -[pbm|pgm|ppm] [path/to/file.ps]`<br><b>Specify the resolution of the output in dots per inch</b>`pstopnm -dpi [n] [path/to/file.ps]`


title: TLDR
content:
<b>Convert a PBM image into a GEM .img file</b>`pbmtogem [path/to/file.pbm] > [path/to/file.img]`<br><b>Suppress all informational messages</b>`pbmtogem [[-q|-quiet]]`<br><b>Display version</b>`pbmtogem [[-v|-version]]`


title: TLDR
content:
<b>Copy a PAM image (i.e. a PBM, PGM, PPM or PAM image) from stdin to stdout</b>`pamtopam < [path/to/image.pam] > [path/to/output.pam]`<br><b>Display version</b>`pamtopam [[-v|-version]]`


title: TLDR
content:
<b>Check the CI status for this branch</b>`hub ci-status [[-v|--verbose]]`<br><b>Display status of GitHub checks for a commit</b>`hub ci-status [[-v|--verbose]] [commit_SHA]`


title: TLDR
content:
<b>Start in interactive mode</b>`ddgr`<br><b>Search DuckDuckGo for a keyword</b>`ddgr [keyword]`<br><b>Limit the number of search results to n</b>`ddgr [[-n|--num]] [n] [keyword]`<br><b>Display the complete URL in search results</b>`ddgr [[-x|--expand]] [keyword]`<br><b>Search DuckDuckGo for a keyword and open the first result in the browser</b>`ddgr !w [keyword]`<br><b>Perform a website-specific search</b>`ddgr [[-w|--site]] [site] [keyword]`<br><b>Search for a specific file type</b>`ddgr [keyword] filetype:[filetype]`<br><b>Display help in interactive mode</b>`<?>`


title: TLDR
content:
<b>Clone an existing repository to current directory (If run into authentication problem, try full SSH path)</b>`hub clone [remote_repository_location]`


title: TLDR
content:
<b>Read Akebas YUV bytes from three files starting with basename, merge them into a single PPM image and store it in the specified output file</b>`yuvsplittoppm [basename] [width] [height] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Add or override the IFACE.PROG record and run the update scripts if updating is enabled</b>`resolvconf -a [IFACE.PROG]`<br><b>Delete the IFACE.PROG record and run the update scripts if updating is enabled</b>`resolvconf -d [IFACR.PROG]`<br><b>Just run the update scripts if updating is enabled</b>`resolvconf -u`<br><b>Set the flag indicating whether resolvconf should run update scripts when invoked with -a, -d or -u</b>`resolvconf --enable-updates`<br><b>Clear the flag indicating whether to run updates</b>`resolvconf --disable-updates`<br><b>Check whether updates are enabled</b>`resolvconf --updates-are-enabled`


title: TLDR
content:
<b>Upgrade all outdated casks and formulae</b>`brew upgrade`<br><b>Upgrade a specific formula/cask</b>`brew upgrade [formula|cask]`<br><b>Print what would be upgraded, but don't actually upgrade anything</b>`brew upgrade [[-n|--dry-run]]`


title: TLDR
content:
<b>Run a doctl databases pool command with an access token</b>`doctl [[d|databases]] [[p|pool]] [command] [[-t|--access-token]] [access_token]`<br><b>Retrieve information about a database connection pool</b>`doctl [[d|databases]] [[p|pool]] [[g|get]] [database_id] [pool_name]`<br><b>List connection pools for a database cluster</b>`doctl [[d|databases]] [[p|pool]] [[ls|list]] [database_id]`<br><b>Create a connection pool for a database</b>`doctl [[d|databases]] [[p|pool]] [[c|create]] [database_id] [pool_name] --db [new_pool_name] --size [pool_size]`<br><b>Delete a connection pool for a database</b>`doctl [[d|databases]] [[p|pool]] [[c|create]] [database_id] [pool_name]`


title: TLDR
content:
<b>Draw a CIE color chart using the REC709 color system as a PPM image</b>`ppmcie > [path/to/output.ppm]`<br><b>Specify the color system to be used</b>`ppmcie -[cie|ebu|hdtv|ntsc|smpte] > [path/to/output.ppm]`<br><b>Specify the location of the individual illuminants</b>`ppmcie -[red|green|blue] [xpos ypos] > [path/to/output.ppm]`<br><b>Do not dim the area outside the Maxwell triangle</b>`ppmcie [[-f|-full]] > [path/to/output.ppm]`


title: TLDR
content:
<b>Pass options to rustdoc</b>`cargo rustdoc -- [rustdoc_options]`<br><b>Warn about a documentation lint</b>`cargo rustdoc -- --warn rustdoc::[lint_name]`<br><b>Ignore a documentation lint</b>`cargo rustdoc -- --allow rustdoc::[lint_name]`<br><b>Document the package's library</b>`cargo rustdoc --lib`<br><b>Document the specified binary</b>`cargo rustdoc --bin [name]`<br><b>Document the specified example</b>`cargo rustdoc --example [name]`<br><b>Document the specified integration test</b>`cargo rustdoc --test [name]`


title: TLDR
content:
<b>Convert a PICT file to a PPM image</b>`picttoppm [path/to/file.pict] > [path/to/file.ppm]`<br><b>Force any images in the PICT file to be output at full resolution</b>`picttoppm [[-fu|-fullres]] [path/to/file.pict] > [path/to/file.ppm]`<br><b>Do not assume that the input file contains a PICT header and execute quickdraw operations only</b>`picttoppm [[-n|-noheader]] [[-quic|-quickdraw]] [path/to/file.pict] > [path/to/file.ppm]`


title: TLDR
content:
<b>List AKS clusters</b>`az aks list [[-g|--resource-group]] [resource_group]`<br><b>Create a new AKS cluster</b>`az aks create [[-g|--resource-group]] [resource_group] [[-n|--name]] [name] [[-c|--node-count]] [count] --node-vm-size [size]`<br><b>Delete an AKS cluster</b>`az aks delete [[-g|--resource-group]] [resource_group] [[-n|--name]] [name]`<br><b>Get the access credentials for an AKS cluster</b>`az aks get-credentials [[-g|--resource-group]] [resource_group] [[-n|--name]] [name]`<br><b>Get the upgrade versions available for an AKS cluster</b>`az aks get-upgrades [[-g|--resource-group]] [resource_group] [[-n|--name]] [name]`


title: TLDR
content:
<b>Add a package to the project in the current directory</b>`dotnet add package [package]`<br><b>Add a package to a specific project</b>`dotnet add [path/to/file.csproj] package [package]`<br><b>Add a specific version of a package to the project</b>`dotnet add package [package] [[-v|--version]] [1.0.0]`<br><b>Add a package using a specific NuGet source</b>`dotnet add package [package] [[-s|--source]] [https://api.nuget.org/v3/index.json]`<br><b>Add a package only when targeting a specific framework</b>`dotnet add package [package] [[-f|--framework]] [net7.0]`<br><b>Add and specify the directory where to restore packages (~/.nuget/packages by default)</b>`dotnet add package [package] --package-directory [path/to/directory]`


title: TLDR
content:
<b>Upload the current (local-only) repository to your GitHub account as public</b>`hub create`<br><b>Create a private repository and open the new repository in a web browser</b>`hub create [[-p|--private]] [[-o|--browse]]`


title: TLDR
content:
<b>Produce a grayscale version of the specified PPM image</b>`ppmdist [path/to/input.ppm] > [path/to/output.pgm]`<br><b>Use the specified method to map colors to graylevels</b>`ppmdist -[frequency|intensity] [path/to/input.ppm] > [path/to/output.pgm]`


title: TLDR
content:
<b>Convert a PNM image to an RLE image</b>`pnmtorle [path/to/input.pnm] > [path/to/output.rle]`<br><b>Print PNM header information to stdout</b>`pnmtorle [[-verb|-verbose]] [path/to/input.pnm] > [path/to/output.rle]`<br><b>Include a transparency channel in the output image in which every black pixel is set to fully transparent and every other pixel is set to fully opaque</b>`pnmtorle [[-a|-alpha]] [path/to/input.pnm] > [path/to/output.rle]`


title: TLDR
content:
<b>Specify the color theme (defaults to theme.ron)</b>`gitui --theme [theme]`<br><b>Store logging output into a cache directory</b>`gitui --logging`<br><b>Use notify-based file system watcher instead of tick-based update</b>`gitui --watcher`<br><b>Generate a bug report</b>`gitui --bugreport`<br><b>Use a specific Git directory</b>`gitui --directory [path/to/directory]`<br><b>Use a specific working directory</b>`gitui --workdir [path/to/directory]`<br><b>Display help</b>`gitui --help`<br><b>Display version</b>`gitui --version`


title: TLDR
content:
<b>Generate a PPM image file as output for an Interleaf image file as input</b>`leaftoppm [path/to/file.pl]`<br><b>Display version</b>`leaftoppm [[-v|-version]]`


title: TLDR
content:
<b>Install a specific Node.js version</b>`Install-NodeVersion [node_version]`<br><b>Install multiple Node.js versions</b>`Install-NodeVersion [node_version1 , node_version2 , ...]`<br><b>Install latest available version of Node.js 20</b>`Install-NodeVersion ^20`<br><b>Install the x86 (x86 32-bit) / x64 (x86 64-bit) / arm64 (ARM 64-bit) version of Node.js</b>`Install-NodeVersion [node_version] -Architecture [x86|x64|arm64]`<br><b>Use a HTTP proxy to download Node.js</b>`Install-NodeVersion [node-version] -Proxy [http://example.com]`


title: TLDR
content:
<b>Convert a PPM image to an ILBM file</b>`ppmtoilbm [path/to/file.ppm] > [path/to/file.ilbm]`<br><b>Write a maximum of n planes to the ILBM file and produce a HAM/24bit/direct color file if this number is exceeded</b>`ppmtoilbm [[-mp|-maxplanes]] [n] -[hamif|24if|dcif] [path/to/file.ppm] > [path/to/file.ilbm]`<br><b>Produce a ILBM file with exactly n planes</b>`ppmtoilbm [[-fp|-fixplanes]] [n] [path/to/file.ppm] > [path/to/file.ilbm]`<br><b>Select the compression method to be used</b>`ppmtoilbm -[compress|nocompress|savemem] [path/to/file.ppm] > [path/to/file.ilbm]`


title: TLDR
content:
<b>Convert a raw RGB stream to a PPM image</b>`rawtoppm [width] [height] [path/to/image.raw] > [path/to/output.ppm]`<br><b>Convert a raw RGB stream in which the pixels come bottom-first instead of top-first to a PPM image</b>`rawtoppm [width] [height] [path/to/image.raw] | pamflip [[-tb|-topbottom]] > [path/to/output.ppm]`<br><b>Ignore the first n bytes of the specified file</b>`rawtoppm [width] [height] [[-h|-headerskip]] [n] [path/to/image.raw] > [path/to/output.ppm]`<br><b>Ignore the last m bytes of each row in the specified file</b>`rawtoppm [width] [height] [[-ro|-rowskip]] [m] [path/to/image.raw] > [path/to/output.ppm]`<br><b>Specify the order of color components for each pixel</b>`rawtoppm [width] [height] -[rgb|rbg|grb|gbr|brg|bgr] [path/to/image.raw] > [path/to/output.ppm]`


title: TLDR
content:
<b>Rename a container</b>`docker rename [container] [new_name]`<br><b>Display help</b>`docker rename --help`


title: TLDR
content:
<b>Read a PBM image, set its maxval and save it to a file</b>`pamdepth [maxval] [path/to/image.pbm] > [path/to/file.pbm]`


title: TLDR
content:
<b>Run a doctl databases replica command with an access token</b>`doctl [[d|databases]] [[p|pool]] [command] [[-t|--access-token]] [access_token]`<br><b>Retrieve information about a read-only database replica</b>`doctl [[d|databases]] [[r|replica]] [[g|get]] [database_id] [replica_name]`<br><b>Retrieve list of read-only database replicas</b>`doctl [[d|databases]] [[r|replica]] [[ls|list]] [database_id]`<br><b>Create a read-only database replica</b>`doctl [[d|databases]] [[r|replica]] [[c|create]] [database_id] [replica_name]`<br><b>Delete a read-only database replica</b>`doctl [[d|databases]] [[r|replica]] [[rm|delete]] [database_id] [replica_name]`


title: TLDR
content:
<b>Displace the pixels in a PPM image by a randomized amount that is at most a</b>`ppmspread [a] [path/to/input_file.ppm] > [path/to/output_file.ppm]`<br><b>Specify a seed to a the pseudo-random number generator</b>`ppmspread [a] [path/to/input_file.ppm] [[-r|-randomseed]] [seed] > [path/to/output_file.ppm]`


title: TLDR
content:
<b>Read a PBM file as input and produce an ASCII output</b>`pbmtoascii [path/to/input_file.pbm]`<br><b>Read a PBM file as input and save an ASCII output into a file</b>`pbmtoascii [path/to/input_file.pbm] > [path/to/output_file]`<br><b>Read a PBM file as input while setting the pixel mapping (defaults to 1x2)</b>`pbmtoascii -[1x2|2x4] [path/to/input_file.pbm]`<br><b>Display version</b>`pbmtoascii [[-v|-version]]`


title: TLDR
content:
<b>Exchange the first color in each oldcolor - newcolor pair with the second color</b>`ppmchange [oldcolor1 newcolor1 oldcolor2 newcolor2 ...] [path/to/input.ppm] > [path/to/output.ppm]`<br><b>Specify how similar colors must be in order to be considered the same</b>`ppmchange -closeness [percentage] [oldcolor1 newcolor1 oldcolor2 newcolor2 ...] [path/to/input.ppm] > [path/to/output.ppm]`<br><b>Replace all pixels not specified in the arguments by a color</b>`ppmchange [[-r|-remainder]] [color] [oldcolor1 newcolor1 oldcolor2 newcolor2 ...] [path/to/input.ppm] > [path/to/output.ppm]`


title: TLDR
content:
<b>Remove containers</b>`docker rm [container1 container2 ...]`<br><b>Force remove a container</b>`docker rm [[-f|--force]] [container1 container2 ...]`<br><b>Remove a container and its volumes</b>`docker rm [[-v|--volumes]] [container]`<br><b>Display help</b>`docker rm [[-h|--help]]`


title: TLDR
content:
<b>Read a PNM image as input and produce a PNG image as output</b>`pnmtopng [path/to/file.pnm] > [path/to/file.png]`<br><b>Display version</b>`pnmtopng [[-vers|-version]]`


title: TLDR
content:
<b>Read a Biorad confocal file and store the n'th image contained in it to as a PGM file</b>`bioradtopgm -[n] [path/to/file.pic] > [path/to/file.pgm]`<br><b>Read a Biorad confocal file and print the number of images it contains</b>`bioradtopgm [path/to/file.pic]`<br><b>Display version</b>`bioradtopgm [[-v|-version]]`


title: TLDR
content:
<b>List all installed Node.js versions</b>`Get-NodeVersions`<br><b>List all available Node.js versions</b>`Get-NodeVersions -Remote`<br><b>List all available Node.js 20.x versions</b>`Get-NodeVersions -Remote -Filter ">=20.0.0 <21.0.0"`


title: TLDR
content:
<b>Convert a PBM file to an HP LaserJet file</b>`pbmtolj [path/to/input.pbm] > [path/to/output.lj]`<br><b>Compress the output file using the specified method</b>`pbmtolj -[packbits|delta|compress] [path/to/input.pbm] > [path/to/output.lj]`<br><b>Specify the required resolution</b>`pbmtolj [[-r|-resolution]] [75|100|150|300|600] [path/to/input.pbm] > [path/to/output.lj]`


title: TLDR
content:
<b>Read a PPM image from the input file, convert it to an Abekas YUV image and store it in the specified output file</b>`ppmtoyuv [path/to/input_file.ppm] > [path/to/output_file.yuv]`


title: TLDR
content:
<b>List Azure Advisor configuration for the entire subscription</b>`az advisor configuration list`<br><b>Show Azure Advisor configuration for the given subscription or resource group</b>`az advisor configuration show [[-g|--resource-group]] [resource_group]`<br><b>List Azure Advisor recommendations</b>`az advisor recommendation list`<br><b>Enable Azure Advisor recommendations</b>`az advisor recommendation enable [[-g|--resource-group]] [resource_group]`<br><b>Disable Azure Advisor recommendations</b>`az advisor recommendation disable [[-g|--resource-group]] [resource_group]`


title: TLDR
content:
<b>Convert a PBM image to a WBMP file</b>`pbmtowbmp [path/to/input_file.pbm] > [path/to/output_file.wbmp]`


title: TLDR
content:
<b>Show total blame count</b>`git guilt`<br><b>Calculate the change in blame between two revisions</b>`git guilt [first_revision] [last_revision]`<br><b>Show author emails instead of names</b>`git guilt [[-e|--email]]`<br><b>Ignore whitespace only changes when attributing blame</b>`git guilt [[-w|--ignore-whitespace]]`<br><b>Find blame delta over the last three weeks</b>`git guilt 'git log --until "3 weeks ago" --format "%H" [[-n|--max-count]] 1'`<br><b>Find blame delta over the last three weeks (git 1.8.5+)</b>`git guilt @{3.weeks.ago}`


title: TLDR
content:
<b>Convert a HP ThinkJet printer commands file to a PBM file</b>`thinkjettopbm [path/to/input] > [path/to/output.pbm]`<br><b>Print debug information to stderr</b>`thinkjettopbm [[-d|-debug]] [path/to/input] > [path/to/output.pbm]`


title: TLDR
content:
<b>List domains</b>`cli53 list`<br><b>Create a domain</b>`cli53 create [example.com] --comment "[comment]"`<br><b>Export a bind zone file to stdout</b>`cli53 export [example.com]`<br><b>Create a www subdomain pointing to a relative record in the same zone</b>`cli53 [[rc|rrcreate]] [example.com] '[www 300 CNAME lb]'`<br><b>Create a www subdomain pointing to an external address (must end with a dot)</b>`cli53 [[rc|rrcreate]] [example.com] '[www 300 CNAME lb.example.com.]'`<br><b>Create a www subdomain pointing to an IP address</b>`cli53 [[rc|rrcreate]] [example.com] '[www 300 A 150.130.110.1]'`<br><b>Replace a www subdomain pointing to a different IP</b>`cli53 [[rc|rrcreate]] --replace '[www 300 A 150.130.110.2]'`<br><b>Delete a record A</b>`cli53 [[rd|rrdelete]] [example.com] [www] [A]`


title: TLDR
content:
<b>Convert a Palm bitmap to a PNM image</b>`palmtopnm [path/to/file.palm] > [path/to/file.pnm]`<br><b>Display information about the input file</b>`palmtopnm [[-verb|-verbose]] [path/to/file.palm] > [path/to/file.pnm]`<br><b>Convert the n'th rendition of the image contained in the input file</b>`palmtopnm [[-r|-rendition]] [n] [path/to/file.palm] > [path/to/file.pnm]`<br><b>Write a histogram of the colors in the input file to stdout</b>`palmtopnm [[-s|-showhist]] [path/to/file.palm] > [path/to/file.pnm]`<br><b>Output the transparent color of the input image if set</b>`palmtopnm [[-t|-transparent]] [path/to/file.palm]`


title: TLDR
content:
<b>Convert a PPM file to an HP PaintJet file</b>`ppmtopj [path/to/input.ppm] > [path/to/output.pj]`<br><b>Move the image in the x and y direction</b>`ppmtopj [[-x|-xpos]] [dx] [[-y|-ypos]] [dy] [path/to/input.ppm] > [path/to/output.pj]`<br><b>Explicitly specify a gamma value</b>`ppmtopj [[-g|-gamma]] [gamma] [path/to/input.ppm] > [path/to/output.pj]`


title: TLDR
content:
<b>Convert a PAM image to an XV thumbnail picture</b>`pamtoxvmini [path/to/input_file.pam] > [path/to/output_file]`


title: TLDR
content:
<b>Convert the image data in a PS file to a PGM image of the specified dimensions and quality</b>`psidtopgm [width] [height] [bits_per_sample] [path/to/file.ps] > [path/to/image.pgm]`


title: TLDR
content:
<b>Remove an API token from the local credential storage (located in $CARGO_HOME/credentials.toml)</b>`cargo logout`<br><b>Use the specified registry (registry names can be defined in the configuration - the default is <https://crates.io>)</b>`cargo logout --registry [name]`


title: TLDR
content:
<b>Generate the PBM, PGM, or PNM image as output, for Windows or OS/2 BMP file as input</b>`bmptopnm [path/to/file.bmp]`<br><b>Report contents of the BMP header to stderr</b>`bmptopnm [[-verb|-verbose]] [path/to/file.bmp]`<br><b>Display version</b>`bmptopnm [[-v|-version]]`


title: TLDR
content:
<b>Manage a cluster using a kubeconfig context</b>`k9s --context [kubeconfig_context_name]`<br><b>Manage a cluster in read-only mode (disabling all commands that may cause modifications)</b>`k9s --readonly --cluster [cluster_name]`<br><b>Manage a cluster using a given kubernetes namespace</b>`k9s [[-n|--namespace]] [kubernetes_namespace] --cluster [cluster_name]`<br><b>Manage a cluster launching k9s in the pod view and enable debug logging</b>`k9s [[-c|--command]] [pod] [[-l|--logLevel]] debug --cluster [cluster_name]`


title: TLDR
content:
<b>Generate the PPM image as output for an Atari Neochrome NEO file as input</b>`neotoppm [path/to/file.neo]`<br><b>Display version</b>`neotoppm [[-v|-version]]`


title: TLDR
content:
<b>Convert a PNM image to a PS file</b>`pnmtops [path/to/file.pnm] > [path/to/file.ps]`<br><b>Specify the dimensions of the output image in inches</b>`pnmtops [[-imagew|-imagewidth]] [imagewidth] [[-imageh|-imageheight]] [imageheight] [path/to/file.pnm] > [path/to/file.ps]`<br><b>Specify the dimensions of the page the output image resides on in inches</b>`pnmtops [[-w|-width]] [width] [[-h|-height]] [height] [path/to/file.pnm] > [path/to/file.ps]`


title: TLDR
content:
<b>Convert a GIF image to a Netpbm image pixel-for-pixel</b>`giftopnm [path/to/input.gif] > [path/to/output.pnm]`<br><b>Display version</b>`giftopnm [[-v|-version]]`


title: TLDR
content:
<b>List all outdated casks and formulae</b>`brew outdated`<br><b>List only outdated formulae</b>`brew outdated --formula`<br><b>List only outdated casks</b>`brew outdated --cask`


title: TLDR
content:
<b>Install a package from <https://crates.io> (the version is optional - latest by default)</b>`cargo install [package]@[version]`<br><b>Install a package from the specified Git repository</b>`cargo install --git [repo_url]`<br><b>Build from the specified branch/tag/commit when installing from a Git repository</b>`cargo install --git [repo_url] --[branch|tag|rev] [branch_name|tag|commit_hash]`<br><b>Install a package from a local directory</b>`cargo install --path [path/to/package]`<br><b>List all installed packages and their versions</b>`cargo install --list`


title: TLDR
content:
<b>Read a PGM image, apply dithering and save it to a file</b>`pamditherbw [path/to/image.pgm] > [path/to/file.pgm]`<br><b>Use the specified quantization method</b>`pamditherbw -[floyd|fs|atkinson|threshold|hilbert|...] [path/to/image.pgm] > [path/to/file.pgm]`<br><b>Use the atkinson quantization method and the specified seed for a pseudo-random number generator</b>`pamditherbw [[-a|-atkinson]] [[-r|-randomseed]] [1337] [path/to/image.pgm] > [path/to/file.pgm]`<br><b>Specify the thresholding value for quantization methods that perform some sort of thresholding</b>`pamditherbw -[fs|atkinson|thresholding] [[-va|-value]] [0.3] [path/to/image.pgm] > [path/to/file.pgm]`


title: TLDR
content:
<b>Convert a PNM image file to XWD</b>`pnmtoxwd [path/to/input_file.pnm] > [path/to/output_file.xwd]`<br><b>Produce the output in the DirectColor format</b>`pnmtoxwd [[-d|-directcolor]] [path/to/input_file.pnm] > [path/to/output_file.xwd]`<br><b>Set the color depth of the output to b bits</b>`pnmtoxwd [[-ps|-pseudodepth]] [b] [path/to/input_file.pnm] > [path/to/output_file.xwd]`


title: TLDR
content:
<b>Convert a PNM image to an SGI image</b>`pnmtosgi [path/to/input.pnm] > [path/to/output.sgi]`<br><b>Disable or enable compression</b>`pnmtosgi -[verbatim|rle] [path/to/input.pnm] > [path/to/output.sgi]`<br><b>Write the specified string into the SGI image header's imagename field</b>`pnmtosgi [[-i|-imagename]] [string] [path/to/input.pnm] > [path/to/output.sgi]`


title: TLDR
content:
<b>Delete an empty S3 bucket</b>`aws s3 rb s3://[bucket_name]`<br><b>Force delete an S3 bucket and its non-versioned objects (will crash if versioned objects are present)</b>`aws s3 rb s3://[bucket_name] --force`


title: TLDR
content:
<b>Convert a PGM image file to the SBIG CCDOPS format</b>`pgmtosbig [path/to/input_file.pgm] > [path/to/output.sbig]`


title: TLDR
content:
<b>Read a PPM image from the input file, convert it to three subsampled Abekas YUV image and store these images to output files starting with the specified basename</b>`ppmtoyuvsplit [basename] [path/to/input_file.ppm]`


title: TLDR
content:
<b>Apply taint to a node</b>`kubectl taint [[no|nodes]] [node_name] [label_key]=[label_value]:[effect]`<br><b>Remove taint from a node</b>`kubectl taint [[no|nodes]] [node_name] [label_key]:[effect]-`<br><b>Remove all taints from a node</b>`kubectl taint [[no|nodes]] [node_name] [label_key]-`


title: TLDR
content:
<b>Read a PPM image, apply dithering and save it to a file</b>`ppmdither [path/to/image.ppm] > [path/to/file.ppm]`<br><b>Specify the desired number of shades for each primary color</b>`ppmdither [[-r|-red]] [2] [[-g|-green]] [3] [[-b|-blue]] [2] [path/to/image.ppm] > [path/to/file.ppm]`<br><b>Specify the dimensions of the dithering matrix</b>`ppmdither [[-d|-dim]] [2] [path/to/image.ppm] > [path/to/file.ppm]`


title: TLDR
content:
<b>Send the patches between the current branch and its upstream to a pastebin using pastebinit</b>`git paste`<br><b>Pass options to git format-patch in order to select a different set of commits (@^ selects the parent of HEAD, and so the currently checked out commit is sent)</b>`git paste [@^]`


title: DESCRIPTION
content:
<p><b>-P</b> string</p>
<blockquote>
<p>Password for Basic Auth (dir mode only)</p>
</blockquote>
<p><b>-U</b> string</p>
<blockquote>
<p>Username for Basic Auth (dir mode only)</p>
</blockquote>
<p><b>-a</b> string</p>
<blockquote>
<p>Set the User-Agent string (dir mode only)</p>
</blockquote>
<p><b>-c</b> string</p>
<blockquote>
<p>Cookies to use for the requests (dir mode only)</p>
</blockquote>
<p><b>-cn</b></p>
<blockquote>
<p>Show CNAME records (dns mode only, cannot be used with '-i'
option)</p>
</blockquote>
<dl>
<dt><b>-e</b></dt>
<dd>
<p>Expanded mode, print full URLs</p>
</dd>
<dt><b>-f</b></dt>
<dd>
<p>Append a forward-slash to each directory request (dir mode only)</p>
</dd>
</dl>
<p><b>-fw</b></p>
<blockquote>
<p>Force continued operation when wildcard found</p>
</blockquote>
<dl>
<dt><b>-i</b></dt>
<dd>
<p>Show IP addresses (dns mode only)</p>
</dd>
<dt><b>-k</b></dt>
<dd>
<p>Skip SSL certificate verification</p>
</dd>
<dt><b>-l</b></dt>
<dd>
<p>Include the length of the body in the output (dir mode only)</p>
</dd>
</dl>
<p><b>-m</b> string</p>
<blockquote>
<p>Directory/File mode (dir) or DNS mode (dns) (default "dir")</p>
</blockquote>
<dl>
<dt><b>-n</b></dt>
<dd>
<p>Don't print status codes</p>
</dd>
</dl>
<p><b>-o</b> string</p>
<blockquote>
<p>Output file to write results to (defaults to stdout)</p>
</blockquote>
<p><b>-p</b> string</p>
<blockquote>
<p>Proxy to use for requests [http(s)://host:port] (dir mode only)</p>
</blockquote>
<dl>
<dt><b>-q</b></dt>
<dd>
<p>Don't print the banner and other noise</p>
</dd>
<dt><b>-r</b></dt>
<dd>
<p>Follow redirects</p>
</dd>
</dl>
<p><b>-s</b> string</p>
<blockquote>
<p>Positive status codes (dir mode only) (default
"200,204,301,302,307")</p>
</blockquote>
<p><b>-t</b> int</p>
<blockquote>
<p>Number of concurrent threads (default 10)</p>
</blockquote>
<p><b>-u</b> string</p>
<blockquote>
<p>The target URL or Domain</p>
</blockquote>
<dl>
<dt><b>-v</b></dt>
<dd>
<p>Verbose output (errors)</p>
</dd>
</dl>
<p><b>-w</b> string</p>
<blockquote>
<p>Path to the wordlist</p>
</blockquote>
<p><b>-x</b> string</p>
<blockquote>
<p>File extension(s) to search for (dir mode only)</p>
</blockquote>


title: SYNOPSIS
content:
<p><b>jq</b> [<em>options</em>...] <em>filter</em>
[<em>files</em>...]</p>
<p><b>jq</b> can transform JSON in various ways, by selecting,
iterating, reducing and otherwise mangling JSON documents. For instance,
running the command <b>jq 'map(.price) | add'</b> will take an
array of JSON objects as input and return the sum of their "price"
fields.</p>
<p><b>jq</b> can accept text input as well, but by default,
<b>jq</b> reads a stream of JSON entities (including numbers
and other literals) from <b>stdin</b>. Whitespace is only
needed to separate entities such as 1 and 2, and true and false. One or
more <em>files</em> may be specified, in which case <b>jq</b>
will read input from those instead.</p>
<p>The <em>options</em> are described in the [INVOKING JQ] section; they
mostly concern input and output formatting. The <em>filter</em> is
written in the jq language and specifies how to transform the input file
or document.</p>


title: FILTERS
content:
<p>A jq program is a "filter": it takes an input, and produces an
output. There are a lot of builtin filters for extracting a particular
field of an object, or converting a number to a string, or various other
standard tasks.</p>
<p>Filters can be combined in various ways - you can pipe the output of
one filter into another filter, or collect the output of a filter into
an array.</p>
<p>Some filters produce multiple results, for instance there's one that
produces all the elements of its input array. Piping that filter into a
second runs the second filter for each element of the array. Generally,
things that would be done with loops and iteration in other languages
are just done by gluing filters together in jq.</p>
<p>It's important to remember that every filter has an input and an
output. Even literals like "hello" or 42 are filters - they take an
input but always produce the same literal as output. Operations that
combine two filters, like addition, generally feed the same input to
both and combine the results. So, you can implement an averaging filter
as <b>add / length</b> - feeding the input array both to the
<b>add</b> filter and the <b>length</b> filter and
then performing the division.</p>
<p>But that's getting ahead of ourselves. :) Let's start with something
simpler:</p>


title: INVOKING JQ
content:
<p>jq filters run on a stream of JSON data. The input to jq is parsed as
a sequence of whitespace-separated JSON values which are passed through
the provided filter one at a time. The output(s) of the filter are
written to standard output, as a sequence of newline-separated JSON
data.</p>
<p>The simplest and most common filter (or jq program) is
<b>.</b>, which is the identity operator, copying the inputs
of the jq processor to the output stream. Because the default behavior
of the jq processor is to read JSON texts from the input stream, and to
pretty-print outputs, the <b>.</b> program's main use is to
validate and pretty-print the inputs. The jq programming language is
quite rich and allows for much more than just validation and
pretty-printing.</p>
<p>Note: it is important to mind the shell's quoting rules. As a general
rule it's best to always quote (with single-quote characters on Unix
shells) the jq program, as too many characters with special meaning to
jq are also shell meta-characters. For example, <b>jq
"foo"</b> will fail on most Unix shells because that will be the
same as <b>jq foo</b>, which will generally fail because
<b>foo is not defined</b>. When using the Windows command
shell (cmd.exe) it's best to use double quotes around your jq program
when given on the command-line (instead of the <b>-f
program-file</b> option), but then double-quotes in the jq program
need backslash escaping. When using the Powershell
(<b>powershell.exe</b>) or the Powershell Core
(<b>pwsh</b>/<b>pwsh.exe</b>), use single-quote
characters around the jq program and backslash-escaped double-quotes
(<b>\"</b>) inside the jq program.</p>
<ul>
<li><p>Unix shells: <b>jq '.["foo"]'</b></p></li>
<li><p>Powershell: <b>jq '.[\"foo\"]'</b></p></li>
<li><p>Windows command shell: <b>jq ".[\"foo\"]"</b></p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Note: jq allows user-defined functions, but every jq program must
have a top-level expression.</p>
<p>You can affect how jq reads and writes its input and output using
some command-line options:</p>
<dl>
<dt><b>--null-input</b> / <b>-n</b>:</dt>
<dd>
<p>Don't read any input at all. Instead, the filter is run once using
<b>null</b> as the input. This is useful when using jq as a
simple calculator or to construct JSON data from scratch.</p>
</dd>
<dt><b>--raw-input</b> / <b>-R</b>:</dt>
<dd>
<p>Don't parse the input as JSON. Instead, each line of text is passed
to the filter as a string. If combined with <b>--slurp</b>,
then the entire input is passed to the filter as a single long
string.</p>
</dd>
<dt><b>--slurp</b> / <b>-s</b>:</dt>
<dd>
<p>Instead of running the filter for each JSON object in the input, read
the entire input stream into a large array and run the filter just
once.</p>
</dd>
<dt><b>--compact-output</b> / <b>-c</b>:</dt>
<dd>
<p>By default, jq pretty-prints JSON output. Using this option will
result in more compact output by instead putting each JSON object on a
single line.</p>
</dd>
<dt><b>--raw-output</b> / <b>-r</b>:</dt>
<dd>
<p>With this option, if the filter's result is a string then it will be
written directly to standard output rather than being formatted as a
JSON string with quotes. This can be useful for making jq filters talk
to non-JSON-based systems.</p>
</dd>
<dt><b>--raw-output0</b>:</dt>
<dd>
<p>Like <b>-r</b> but jq will print NUL instead of newline
after each output. This can be useful when the values being output can
contain newlines. When the output value contains NUL, jq exits with
non-zero code.</p>
</dd>
<dt><b>--join-output</b> / <b>-j</b>:</dt>
<dd>
<p>Like <b>-r</b> but jq won't print a newline after each
output.</p>
</dd>
<dt><b>--ascii-output</b> / <b>-a</b>:</dt>
<dd>
<p>jq usually outputs non-ASCII Unicode codepoints as UTF-8, even if the
input specified them as escape sequences (like "\u03bc"). Using this
option, you can force jq to produce pure ASCII output with every
non-ASCII character replaced with the equivalent escape sequence.</p>
</dd>
<dt><b>--sort-keys</b> / <b>-S</b>:</dt>
<dd>
<p>Output the fields of each object with the keys in sorted order.</p>
</dd>
<dt><b>--color-output</b> / <b>-C</b> and
<b>--monochrome-output</b> / <b>-M</b>:</dt>
<dd>
<p>By default, jq outputs colored JSON if writing to a terminal. You can
force it to produce color even if writing to a pipe or a file using
<b>-C</b>, and disable color with <b>-M</b>. When
the <b>NO_COLOR</b> environment variable is not empty, jq
disables colored output by default, but you can enable it by
<b>-C</b>.</p>
<p>Colors can be configured with the <b>JQ_COLORS</b>
environment variable (see below).</p>
</dd>
<dt><b>--tab</b>:</dt>
<dd>
<p>Use a tab for each indentation level instead of two spaces.</p>
</dd>
<dt><b>--indent n</b>:</dt>
<dd>
<p>Use the given number of spaces (no more than 7) for indentation.</p>
</dd>
<dt><b>--unbuffered</b>:</dt>
<dd>
<p>Flush the output after each JSON object is printed (useful if you're
piping a slow data source into jq and piping jq's output elsewhere).</p>
</dd>
<dt><b>--stream</b>:</dt>
<dd>
<p>Parse the input in streaming fashion, outputting arrays of path and
leaf values (scalars and empty arrays or empty objects). For example,
<b>"a"</b> becomes <b>[[],"a"]</b>, and
<b>[[],"a",["b"]]</b> becomes <b>[[0],[]]</b>,
<b>[[1],"a"]</b>, and <b>[[2,0],"b"]</b>.</p>
<p>This is useful for processing very large inputs. Use this in
conjunction with filtering and the <b>reduce</b> and
<b>foreach</b> syntax to reduce large inputs
incrementally.</p>
</dd>
<dt><b>--stream-errors</b>:</dt>
<dd>
<p>Like <b>--stream</b>, but invalid JSON inputs yield array
values where the first element is the error and the second is a path.
For example, <b>["a",n]</b> produces <b>["Invalid literal
at line 1, column 7",[1]]</b>.</p>
<p>Implies <b>--stream</b>. Invalid JSON inputs produce no
error values when <b>--stream</b> without
<b>--stream-errors</b>.</p>
</dd>
<dt><b>--seq</b>:</dt>
<dd>
<p>Use the <b>application/json-seq</b> MIME type scheme for
separating JSON texts in jq's input and output. This means that an ASCII
RS (record separator) character is printed before each value on output
and an ASCII LF (line feed) is printed after every output. Input JSON
texts that fail to parse are ignored (but warned about), discarding all
subsequent input until the next RS. This mode also parses the output of
jq without the <b>--seq</b> option.</p>
</dd>
<dt><b>-f filename</b> / <b>--from-file
filename</b>:</dt>
<dd>
<p>Read filter from the file rather than from a command line, like awk's
-f option. You can also use '#' to make comments.</p>
</dd>
<dt><b>-L directory</b>:</dt>
<dd>
<p>Prepend <b>directory</b> to the search list for modules. If
this option is used then no builtin search list is used. See the section
on modules below.</p>
</dd>
<dt><b>--arg name value</b>:</dt>
<dd>
<p>This option passes a value to the jq program as a predefined
variable. If you run jq with <b>--arg foo bar</b>, then
<b>$foo</b> is available in the program and has the value
<b>"bar"</b>. Note that <b>value</b> will be treated
as a string, so <b>--arg foo 123</b> will bind
<b>$foo</b> to <b>"123"</b>.</p>
<p>Named arguments are also available to the jq program as
<b>$ARGS.named</b>.</p>
</dd>
<dt><b>--argjson name JSON-text</b>:</dt>
<dd>
<p>This option passes a JSON-encoded value to the jq program as a
predefined variable. If you run jq with <b>--argjson foo
123</b>, then <b>$foo</b> is available in the program and
has the value <b>123</b>.</p>
</dd>
<dt><b>--slurpfile variable-name filename</b>:</dt>
<dd>
<p>This option reads all the JSON texts in the named file and binds an
array of the parsed JSON values to the given global variable. If you run
jq with <b>--slurpfile foo bar</b>, then <b>$foo</b>
is available in the program and has an array whose elements correspond
to the texts in the file named <b>bar</b>.</p>
</dd>
<dt><b>--rawfile variable-name filename</b>:</dt>
<dd>
<p>This option reads in the named file and binds its contents to the
given global variable. If you run jq with <b>--rawfile foo
bar</b>, then <b>$foo</b> is available in the program and
has a string whose contents are to the texts in the file named
<b>bar</b>.</p>
</dd>
<dt><b>--args</b>:</dt>
<dd>
<p>Remaining arguments are positional string arguments. These are
available to the jq program as <b>$ARGS.positional[]</b>.</p>
</dd>
<dt><b>--jsonargs</b>:</dt>
<dd>
<p>Remaining arguments are positional JSON text arguments. These are
available to the jq program as <b>$ARGS.positional[]</b>.</p>
</dd>
<dt><b>--exit-status</b> / <b>-e</b>:</dt>
<dd>
<p>Sets the exit status of jq to 0 if the last output value was neither
<b>false</b> nor <b>null</b>, 1 if the last output
value was either <b>false</b> or <b>null</b>, or 4
if no valid result was ever produced. Normally jq exits with 2 if there
was any usage problem or system error, 3 if there was a jq program
compile error, or 0 if the jq program ran.</p>
<p>Another way to set the exit status is with the
<b>halt_error</b> builtin function.</p>
</dd>
<dt><b>--binary</b> / <b>-b</b>:</dt>
<dd>
<p>Windows users using WSL, MSYS2, or Cygwin, should use this option
when using a native jq.exe, otherwise jq will turn newlines (LFs) into
carriage-return-then-newline (CRLF).</p>
</dd>
<dt><b>--version</b> / <b>-V</b>:</dt>
<dd>
<p>Output the jq version and exit with zero.</p>
</dd>
<dt><b>--build-configuration</b>:</dt>
<dd>
<p>Output the build configuration of jq and exit with zero. This output
has no supported format or structure and may change without notice in
future releases.</p>
</dd>
<dt><b>--help</b> / <b>-h</b>:</dt>
<dd>
<p>Output the jq help and exit with zero.</p>
</dd>
<dt><b>--</b>:</dt>
<dd>
<p>Terminates argument processing. Remaining arguments are positional,
either strings, JSON texts, or input filenames, according to whether
<b>--args</b> or <b>--jsonargs</b> were given.</p>
</dd>
<dt><b>--run-tests [filename]</b>:</dt>
<dd>
<p>Runs the tests in the given file or standard input. This must be the
last option given and does not honor all preceding options. The input
consists of comment lines, empty lines, and program lines followed by
one input line, as many lines of output as are expected (one per
output), and a terminating empty line. Compilation failure tests start
with a line containing only <b>%%FAIL</b>, then a line
containing the program to compile, then a line containing an error
message to compare to the actual.</p>
<p>Be warned that this option can change backwards-incompatibly.</p>
</dd>
</dl>


title: BASIC FILTERS
content:
<h2>Identity: .</h2>
<p>The absolute simplest filter is <b>.</b> . This filter
takes its input and produces the same value as output. That is, this is
the identity operator.</p>
<p>Since jq by default pretty-prints all output, a trivial program
consisting of nothing but <b>.</b> can be used to format JSON
output from, say, <b>curl</b>.</p>
<p>Although the identity filter never modifies the value of its input,
jq processing can sometimes make it appear as though it does. For
example, using the current implementation of jq, we would see that the
expression:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
1E1234567890 | .</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>produces <b>1.7976931348623157e+308</b> on at least one
platform. This is because, in the process of parsing the number, this
particular version of jq has converted it to an IEEE754 double-precision
representation, losing precision.</p>
<p>The way in which jq handles numbers has changed over time and further
changes are likely within the parameters set by the relevant JSON
standards. The following remarks are therefore offered with the
understanding that they are intended to be descriptive of the current
version of jq and should not be interpreted as being prescriptive:</p>
<p>(1) Any arithmetic operation on a number that has not already been
converted to an IEEE754 double precision representation will trigger a
conversion to the IEEE754 representation.</p>
<p>(2) jq will attempt to maintain the original decimal precision of
number literals, but in expressions such <b>1E1234567890</b>,
precision will be lost if the exponent is too large.</p>
<p>(3) In jq programs, a leading minus sign will trigger the conversion
of the number to an IEEE754 representation.</p>
<p>(4) Comparisons are carried out using the untruncated big decimal
representation of numbers if available, as illustrated in one of the
following examples.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.&#39;
   &quot;Hello, world!&quot;
=&gt; &quot;Hello, world!&quot;

jq &#39;.&#39;
   0.12345678901234567890123456789
=&gt; 0.12345678901234567890123456789

jq &#39;[., tojson]&#39;
   12345678909876543212345
=&gt; [12345678909876543212345,&quot;12345678909876543212345&quot;]

jq &#39;. &lt; 0.12345678901234567890123456788&#39;
   0.12345678901234567890123456789
=&gt; false

jq &#39;map([., . == 1]) | tojson&#39;
   [1, 1.000, 1.0, 100e-2]
=&gt; &quot;[[1,true],[1.000,true],[1.0,true],[1.00,true]]&quot;

jq &#39;. as $big | [$big, $big + 1] | map(. &gt; 10000000000000000000000000000000)&#39;
   10000000000000000000000000000001
=&gt; [true, false]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Object Identifier-Index: .foo, .foo.bar</h2>
<p>The simplest <em>useful</em> filter has the form
<b>.foo</b>. When given a JSON object (aka dictionary or hash)
as input, <b>.foo</b> produces the value at the key "foo" if
the key is present, or null otherwise.</p>
<p>A filter of the form <b>.foo.bar</b> is equivalent to
<b>.foo | .bar</b>.</p>
<p>The <b>.foo</b> syntax only works for simple,
identifier-like keys, that is, keys that are all made of alphanumeric
characters and underscore, and which do not start with a digit.</p>
<p>If the key contains special characters or starts with a digit, you
need to surround it with double quotes like this:
<b>."foo$"</b>, or else <b>.["foo$"]</b>.</p>
<p>For example <b>.["foo::bar"]</b> and
<b>.["foo.bar"]</b> work while <b>.foo::bar</b> does
not.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.foo&#39;
   {&quot;foo&quot;: 42, &quot;bar&quot;: &quot;less interesting data&quot;}
=&gt; 42

jq &#39;.foo&#39;
   {&quot;notfoo&quot;: true, &quot;alsonotfoo&quot;: false}
=&gt; null

jq &#39;.[&quot;foo&quot;]&#39;
   {&quot;foo&quot;: 42}
=&gt; 42</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Optional Object Identifier-Index: .foo?</h2>
<p>Just like <b>.foo</b>, but does not output an error when
<b>.</b> is not an object.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.foo?&#39;
   {&quot;foo&quot;: 42, &quot;bar&quot;: &quot;less interesting data&quot;}
=&gt; 42

jq &#39;.foo?&#39;
   {&quot;notfoo&quot;: true, &quot;alsonotfoo&quot;: false}
=&gt; null

jq &#39;.[&quot;foo&quot;]?&#39;
   {&quot;foo&quot;: 42}
=&gt; 42

jq &#39;[.foo?]&#39;
   [1,2]
=&gt; []</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Object Index: .[&lt;string&gt;]</h2>
<p>You can also look up fields of an object using syntax like
<b>.["foo"]</b> (<b>.foo</b> above is a shorthand
version of this, but only for identifier-like strings).</p>
<h2>Array Index: .[&lt;number&gt;]</h2>
<p>When the index value is an integer,
<b>.[&lt;number&gt;]</b> can index arrays. Arrays are
zero-based, so <b>.[2]</b> returns the third element.</p>
<p>Negative indices are allowed, with -1 referring to the last element,
-2 referring to the next to last element, and so on.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[0]&#39;
   [{&quot;name&quot;:&quot;JSON&quot;, &quot;good&quot;:true}, {&quot;name&quot;:&quot;XML&quot;, &quot;good&quot;:false}]
=&gt; {&quot;name&quot;:&quot;JSON&quot;, &quot;good&quot;:true}

jq &#39;.[2]&#39;
   [{&quot;name&quot;:&quot;JSON&quot;, &quot;good&quot;:true}, {&quot;name&quot;:&quot;XML&quot;, &quot;good&quot;:false}]
=&gt; null

jq &#39;.[-2]&#39;
   [1,2,3]
=&gt; 2</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Array/String Slice: .[&lt;number&gt;:&lt;number&gt;]</h2>
<p>The <b>.[&lt;number&gt;:&lt;number&gt;]</b> syntax can be
used to return a subarray of an array or substring of a string. The
array returned by <b>.[10:15]</b> will be of length 5,
containing the elements from index 10 (inclusive) to index 15
(exclusive). Either index may be negative (in which case it counts
backwards from the end of the array), or omitted (in which case it
refers to the start or end of the array). Indices are zero-based.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[2:4]&#39;
   [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;]
=&gt; [&quot;c&quot;, &quot;d&quot;]

jq &#39;.[2:4]&#39;
   &quot;abcdefghi&quot;
=&gt; &quot;cd&quot;

jq &#39;.[:3]&#39;
   [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;]
=&gt; [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;]

jq &#39;.[-2:]&#39;
   [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;]
=&gt; [&quot;d&quot;, &quot;e&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Array/Object Value Iterator: .[]</h2>
<p>If you use the <b>.[index]</b> syntax, but omit the index
entirely, it will return <em>all</em> of the elements of an array.
Running <b>.[]</b> with the input <b>[1,2,3]</b>
will produce the numbers as three separate results, rather than as a
single array. A filter of the form <b>.foo[]</b> is equivalent
to <b>.foo | .[]</b>.</p>
<p>You can also use this on an object, and it will return all the values
of the object.</p>
<p>Note that the iterator operator is a generator of values.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[]&#39;
   [{&quot;name&quot;:&quot;JSON&quot;, &quot;good&quot;:true}, {&quot;name&quot;:&quot;XML&quot;, &quot;good&quot;:false}]
=&gt; {&quot;name&quot;:&quot;JSON&quot;, &quot;good&quot;:true}, {&quot;name&quot;:&quot;XML&quot;, &quot;good&quot;:false}

jq &#39;.[]&#39;
   []
=&gt; 

jq &#39;.foo[]&#39;
   {&quot;foo&quot;:[1,2,3]}
=&gt; 1, 2, 3

jq &#39;.[]&#39;
   {&quot;a&quot;: 1, &quot;b&quot;: 1}
=&gt; 1, 1</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>.[]?</h2>
<p>Like <b>.[]</b>, but no errors will be output if . is not
an array or object. A filter of the form <b>.foo[]?</b> is
equivalent to <b>.foo | .[]?</b>.</p>
<h2>Comma: ,</h2>
<p>If two filters are separated by a comma, then the same input will be
fed into both and the two filters' output value streams will be
concatenated in order: first, all of the outputs produced by the left
expression, and then all of the outputs produced by the right. For
instance, filter <b>.foo, .bar</b>, produces both the "foo"
fields and "bar" fields as separate outputs.</p>
<p>The <b>,</b> operator is one way to contruct
generators.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.foo, .bar&#39;
   {&quot;foo&quot;: 42, &quot;bar&quot;: &quot;something else&quot;, &quot;baz&quot;: true}
=&gt; 42, &quot;something else&quot;

jq &#39;.user, .projects[]&#39;
   {&quot;user&quot;:&quot;stedolan&quot;, &quot;projects&quot;: [&quot;jq&quot;, &quot;wikiflow&quot;]}
=&gt; &quot;stedolan&quot;, &quot;jq&quot;, &quot;wikiflow&quot;

jq &#39;.[4,2]&#39;
   [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,&quot;e&quot;]
=&gt; &quot;e&quot;, &quot;c&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Pipe: |</h2>
<p>The | operator combines two filters by feeding the output(s) of the
one on the left into the input of the one on the right. It's similar to
the Unix shell's pipe, if you're used to that.</p>
<p>If the one on the left produces multiple results, the one on the
right will be run for each of those results. So, the expression
<b>.[] | .foo</b> retrieves the "foo" field of each element of
the input array. This is a cartesian product, which can be
surprising.</p>
<p>Note that <b>.a.b.c</b> is the same as <b>.a | .b |
.c</b>.</p>
<p>Note too that <b>.</b> is the input value at the particular
stage in a "pipeline", specifically: where the <b>.</b>
expression appears. Thus <b>.a | . | .b</b> is the same as
<b>.a.b</b>, as the <b>.</b> in the middle refers to
whatever value <b>.a</b> produced.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[] | .name&#39;
   [{&quot;name&quot;:&quot;JSON&quot;, &quot;good&quot;:true}, {&quot;name&quot;:&quot;XML&quot;, &quot;good&quot;:false}]
=&gt; &quot;JSON&quot;, &quot;XML&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Parenthesis</h2>
<p>Parenthesis work as a grouping operator just as in any typical
programming language.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;(. + 2) * 5&#39;
   1
=&gt; 15</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: TYPES AND VALUES
content:
<p>jq supports the same set of datatypes as JSON - numbers, strings,
booleans, arrays, objects (which in JSON-speak are hashes with only
string keys), and "null".</p>
<p>Booleans, null, strings and numbers are written the same way as in
JSON. Just like everything else in jq, these simple values take an input
and produce an output - <b>42</b> is a valid jq expression
that takes an input, ignores it, and returns 42 instead.</p>
<p>Numbers in jq are internally represented by their IEEE754 double
precision approximation. Any arithmetic operation with numbers, whether
they are literals or results of previous filters, will produce a double
precision floating point result.</p>
<p>However, when parsing a literal jq will store the original literal
string. If no mutation is applied to this value then it will make to the
output in its original form, even if conversion to double would result
in a loss.</p>
<h2>Array construction: []</h2>
<p>As in JSON, <b>[]</b> is used to construct arrays, as in
<b>[1,2,3]</b>. The elements of the arrays can be any jq
expression, including a pipeline. All of the results produced by all of
the expressions are collected into one big array. You can use it to
construct an array out of a known quantity of values (as in
<b>[.foo, .bar, .baz]</b>) or to "collect" all the results of
a filter into an array (as in <b>[.items[].name]</b>)</p>
<p>Once you understand the "," operator, you can look at jq's array
syntax in a different light: the expression <b>[1,2,3]</b> is
not using a built-in syntax for comma-separated arrays, but is instead
applying the <b>[]</b> operator (collect results) to the
expression 1,2,3 (which produces three different results).</p>
<p>If you have a filter <b>X</b> that produces four results,
then the expression <b>[X]</b> will produce a single result,
an array of four elements.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.user, .projects[]]&#39;
   {&quot;user&quot;:&quot;stedolan&quot;, &quot;projects&quot;: [&quot;jq&quot;, &quot;wikiflow&quot;]}
=&gt; [&quot;stedolan&quot;, &quot;jq&quot;, &quot;wikiflow&quot;]

jq &#39;[ .[] | . * 2]&#39;
   [1, 2, 3]
=&gt; [2, 4, 6]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Object Construction: {}</h2>
<p>Like JSON, <b>{}</b> is for constructing objects (aka
dictionaries or hashes), as in: <b>{"a": 42, "b": 17}</b>.</p>
<p>If the keys are "identifier-like", then the quotes can be left off,
as in <b>{a:42, b:17}</b>. Variable references as key
expressions use the value of the variable as the key. Key expressions
other than constant literals, identifiers, or variable references, need
to be parenthesized, e.g., <b>{("a"+"b"):59}</b>.</p>
<p>The value can be any expression (although you may need to wrap it in
parentheses if, for example, it contains colons), which gets applied to
the {} expression's input (remember, all filters have an input and an
output).</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{foo: .bar}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>will produce the JSON object <b>{"foo": 42}</b> if given
the JSON object <b>{"bar":42, "baz":43}</b> as its input. You
can use this to select particular fields of an object: if the input is
an object with "user", "title", "id", and "content" fields and you just
want "user" and "title", you can write</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{user: .user, title: .title}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Because that is so common, there's a shortcut syntax for it:
<b>{user, title}</b>.</p>
<p>If one of the expressions produces multiple results, multiple
dictionaries will be produced. If the input's</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;user&quot;:&quot;stedolan&quot;,&quot;titles&quot;:[&quot;JQ Primer&quot;, &quot;More JQ&quot;]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>then the expression</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{user, title: .titles[]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>will produce two outputs:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;user&quot;:&quot;stedolan&quot;, &quot;title&quot;: &quot;JQ Primer&quot;}
{&quot;user&quot;:&quot;stedolan&quot;, &quot;title&quot;: &quot;More JQ&quot;}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Putting parentheses around the key means it will be evaluated as an
expression. With the same input as above,</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{(.user): .titles}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>produces</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;stedolan&quot;: [&quot;JQ Primer&quot;, &quot;More JQ&quot;]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Variable references as keys use the value of the variable as the key.
Without a value then the variable's name becomes the key and its value
becomes the value,</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
&quot;f o o&quot; as $foo | &quot;b a r&quot; as $bar | {$foo, $bar:$foo}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>produces</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;foo&quot;:&quot;f o o&quot;,&quot;b a r&quot;:&quot;f o o&quot;}

jq &#39;{user, title: .titles[]}&#39;
   {&quot;user&quot;:&quot;stedolan&quot;,&quot;titles&quot;:[&quot;JQ Primer&quot;, &quot;More JQ&quot;]}
=&gt; {&quot;user&quot;:&quot;stedolan&quot;, &quot;title&quot;: &quot;JQ Primer&quot;}, {&quot;user&quot;:&quot;stedolan&quot;, &quot;title&quot;: &quot;More JQ&quot;}

jq &#39;{(.user): .titles}&#39;
   {&quot;user&quot;:&quot;stedolan&quot;,&quot;titles&quot;:[&quot;JQ Primer&quot;, &quot;More JQ&quot;]}
=&gt; {&quot;stedolan&quot;: [&quot;JQ Primer&quot;, &quot;More JQ&quot;]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Recursive Descent: ..</h2>
<p>Recursively descends <b>.</b>, producing every value. This
is the same as the zero-argument <b>recurse</b> builtin (see
below). This is intended to resemble the XPath <b>//</b>
operator. Note that <b>..a</b> does not work; use <b>.. |
.a</b> instead. In the example below we use <b>.. |
.a?</b> to find all the values of object keys "a" in any object
found "below" <b>.</b>.</p>
<p>This is particularly useful in conjunction with
<b>path(EXP)</b> (also see below) and the <b>?</b>
operator.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.. | .a?&#39;
   [[{&quot;a&quot;:1}]]
=&gt; 1</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: BUILTIN OPERATORS AND FUNCTIONS
content:
<p>Some jq operators (for instance, <b>+</b>) do different
things depending on the type of their arguments (arrays, numbers, etc.).
However, jq never does implicit type conversions. If you try to add a
string to an object you'll get an error message and no result.</p>
<p>Please note that all numbers are converted to IEEE754 double
precision floating point representation. Arithmetic and logical
operators are working with these converted doubles. Results of all such
operations are also limited to the double precision.</p>
<p>The only exception to this behaviour of number is a snapshot of
original number literal. When a number which originally was provided as
a literal is never mutated until the end of the program then it is
printed to the output in its original literal form. This also includes
cases when the original literal would be truncated when converted to the
IEEE754 double precision floating point number.</p>
<h2>Addition: +</h2>
<p>The operator <b>+</b> takes two filters, applies them both
to the same input, and adds the results together. What "adding" means
depends on the types involved:</p>
<ul>
<li><p><b>Numbers</b> are added by normal arithmetic.</p></li>
<li><p><b>Arrays</b> are added by being concatenated into a
larger array.</p></li>
<li><p><b>Strings</b> are added by being joined into a larger
string.</p></li>
<li><p><b>Objects</b> are added by merging, that is, inserting
all the key-value pairs from both objects into a single combined object.
If both objects contain a value for the same key, the object on the
right of the <b>+</b> wins. (For recursive merge use the
<b>*</b> operator.)</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p><b>null</b> can be added to any value, and returns the
other value unchanged.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.a + 1&#39;
   {&quot;a&quot;: 7}
=&gt; 8

jq &#39;.a + .b&#39;
   {&quot;a&quot;: [1,2], &quot;b&quot;: [3,4]}
=&gt; [1,2,3,4]

jq &#39;.a + null&#39;
   {&quot;a&quot;: 1}
=&gt; 1

jq &#39;.a + 1&#39;
   {}
=&gt; 1

jq &#39;{a: 1} + {b: 2} + {c: 3} + {a: 42}&#39;
   null
=&gt; {&quot;a&quot;: 42, &quot;b&quot;: 2, &quot;c&quot;: 3}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Subtraction: -</h2>
<p>As well as normal arithmetic subtraction on numbers, the
<b>-</b> operator can be used on arrays to remove all
occurrences of the second array's elements from the first array.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;4 - .a&#39;
   {&quot;a&quot;:3}
=&gt; 1

jq &#39;. - [&quot;xml&quot;, &quot;yaml&quot;]&#39;
   [&quot;xml&quot;, &quot;yaml&quot;, &quot;json&quot;]
=&gt; [&quot;json&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Multiplication, division, modulo: *, /, %</h2>
<p>These infix operators behave as expected when given two numbers.
Division by zero raises an error. <b>x % y</b> computes x
modulo y.</p>
<p>Multiplying a string by a number produces the concatenation of that
string that many times. <b>"x" * 0</b> produces
<b>""</b>.</p>
<p>Dividing a string by another splits the first using the second as
separators.</p>
<p>Multiplying two objects will merge them recursively: this works like
addition but if both objects contain a value for the same key, and the
values are objects, the two are merged with the same strategy.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;10 / . * 3&#39;
   5
=&gt; 6

jq &#39;. / &quot;, &quot;&#39;
   &quot;a, b,c,d, e&quot;
=&gt; [&quot;a&quot;,&quot;b,c,d&quot;,&quot;e&quot;]

jq &#39;{&quot;k&quot;: {&quot;a&quot;: 1, &quot;b&quot;: 2}} * {&quot;k&quot;: {&quot;a&quot;: 0,&quot;c&quot;: 3}}&#39;
   null
=&gt; {&quot;k&quot;: {&quot;a&quot;: 0, &quot;b&quot;: 2, &quot;c&quot;: 3}}

jq &#39;.[] | (1 / .)?&#39;
   [1,0,-1]
=&gt; 1, -1</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>abs</h2>
<p>The builtin function <b>abs</b> is defined naively as:
<b>if . &lt; 0 then - . else . end</b>.</p>
<p>For numeric input, this is the absolute value. See the section on the
identity filter for the implications of this definition for numeric
input.</p>
<p>To compute the absolute value of a number as a floating point number,
you may wish use <b>fabs</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;map(abs)&#39;
   [-10, -1.1, -1e-1]
=&gt; [10,1.1,1e-1]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>length</h2>
<p>The builtin function <b>length</b> gets the length of
various different types of value:</p>
<ul>
<li><p>The length of a <b>string</b> is the number of Unicode
codepoints it contains (which will be the same as its JSON-encoded
length in bytes if it's pure ASCII).</p></li>
<li><p>The length of a <b>number</b> is its absolute
value.</p></li>
<li><p>The length of an <b>array</b> is the number of
elements.</p></li>
<li><p>The length of an <b>object</b> is the number of
key-value pairs.</p></li>
<li><p>The length of <b>null</b> is zero.</p></li>
<li><p>It is an error to use <b>length</b> on a
<b>boolean</b>.</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[] | length&#39;
   [[1,2], &quot;string&quot;, {&quot;a&quot;:2}, null, -5]
=&gt; 2, 6, 1, 0, 5</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>utf8bytelength</h2>
<p>The builtin function <b>utf8bytelength</b> outputs the
number of bytes used to encode a string in UTF-8.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;utf8bytelength&#39;
   &quot;\u03bc&quot;
=&gt; 2</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>keys, keys_unsorted</h2>
<p>The builtin function <b>keys</b>, when given an object,
returns its keys in an array.</p>
<p>The keys are sorted "alphabetically", by unicode codepoint order.
This is not an order that makes particular sense in any particular
language, but you can count on it being the same for any two objects
with the same set of keys, regardless of locale settings.</p>
<p>When <b>keys</b> is given an array, it returns the valid
indices for that array: the integers from 0 to length-1.</p>
<p>The <b>keys_unsorted</b> function is just like
<b>keys</b>, but if the input is an object then the keys will
not be sorted, instead the keys will roughly be in insertion order.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;keys&#39;
   {&quot;abc&quot;: 1, &quot;abcd&quot;: 2, &quot;Foo&quot;: 3}
=&gt; [&quot;Foo&quot;, &quot;abc&quot;, &quot;abcd&quot;]

jq &#39;keys&#39;
   [42,3,35]
=&gt; [0,1,2]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>has(key)</h2>
<p>The builtin function <b>has</b> returns whether the input
object has the given key, or the input array has an element at the given
index.</p>
<p><b>has($key)</b> has the same effect as checking whether
<b>$key</b> is a member of the array returned by
<b>keys</b>, although <b>has</b> will be faster.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;map(has(&quot;foo&quot;))&#39;
   [{&quot;foo&quot;: 42}, {}]
=&gt; [true, false]

jq &#39;map(has(2))&#39;
   [[0,1], [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;]]
=&gt; [false, true]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>in</h2>
<p>The builtin function <b>in</b> returns whether or not the
input key is in the given object, or the input index corresponds to an
element in the given array. It is, essentially, an inversed version of
<b>has</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[] | in({&quot;foo&quot;: 42})&#39;
   [&quot;foo&quot;, &quot;bar&quot;]
=&gt; true, false

jq &#39;map(in([0,1]))&#39;
   [2, 0]
=&gt; [false, true]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>map(f), map_values(f)</h2>
<p>For any filter <b>f</b>, <b>map(f)</b> and
<b>map_values(f)</b> apply <b>f</b> to each of the
values in the input array or object, that is, to the values of
<b>.[]</b>.</p>
<p>In the absence of errors, <b>map(f)</b> always outputs an
array whereas <b>map_values(f)</b> outputs an array if given
an array, or an object if given an object.</p>
<p>When the input to <b>map_values(f)</b> is an object, the
output object has the same keys as the input object except for those
keys whose values when piped to <b>f</b> produce no values at
all.</p>
<p>The key difference between <b>map(f)</b> and
<b>map_values(f)</b> is that the former simply forms an array
from all the values of <b>($x|f)</b> for each value, $x, in
the input array or object, but <b>map_values(f)</b> only uses
<b>first($x|f)</b>.</p>
<p>Specifically, for object inputs, <b>map_value(f)</b>
constructs the output object by examining in turn the value of
<b>first(.[$k]|f)</b> for each key, $k, of the input. If this
expression produces no values, then the corresponding key will be
dropped; otherwise, the output object will have that value at the key,
$k.</p>
<p>Here are some examples to clarify the behavior of
<b>map</b> and <b>map_values</b> when applied to
arrays. These examples assume the input is <b>[1]</b> in all
cases:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
map(.+1)          #=&gt;  [2]
map(., .)         #=&gt;  [1,1]
map(empty)        #=&gt;  []

map_values(.+1)   #=&gt;  [2]
map_values(., .)  #=&gt;  [1]
map_values(empty) #=&gt;  []</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p><b>map(f)</b> is equivalent to <b>[.[] | f]</b>
and <b>map_values(f)</b> is equivalent to <b>.[] |=
f</b>.</p>
<p>In fact, these are their implementations.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;map(.+1)&#39;
   [1,2,3]
=&gt; [2,3,4]

jq &#39;map_values(.+1)&#39;
   {&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: 3}
=&gt; {&quot;a&quot;: 2, &quot;b&quot;: 3, &quot;c&quot;: 4}

jq &#39;map(., .)&#39;
   [1,2]
=&gt; [1,1,2,2]

jq &#39;map_values(. // empty)&#39;
   {&quot;a&quot;: null, &quot;b&quot;: true, &quot;c&quot;: false}
=&gt; {&quot;b&quot;:true}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>pick(pathexps)</h2>
<p>Emit the projection of the input object or array defined by the
specified sequence of path expressions, such that if <b>p</b>
is any one of these specifications, then <b>(. | p)</b> will
evaluate to the same value as <b>(. | pick(pathexps) | p)</b>.
For arrays, negative indices and <b>.[m:n]</b> specifications
should not be used.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;pick(.a, .b.c, .x)&#39;
   {&quot;a&quot;: 1, &quot;b&quot;: {&quot;c&quot;: 2, &quot;d&quot;: 3}, &quot;e&quot;: 4}
=&gt; {&quot;a&quot;:1,&quot;b&quot;:{&quot;c&quot;:2},&quot;x&quot;:null}

jq &#39;[1,2,3,4] | pick(.[2], .[0], .[0])&#39;
   [1,2,3,4]
=&gt; [1,null,3]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>path(path_expression)</h2>
<p>Outputs array representations of the given path expression in
<b>.</b>. The outputs are arrays of strings (object keys)
and/or numbers (array indices).</p>
<p>Path expressions are jq expressions like <b>.a</b>, but
also <b>.[]</b>. There are two types of path expressions: ones
that can match exactly, and ones that cannot. For example,
<b>.a.b.c</b> is an exact match path expression, while
<b>.a[].b</b> is not.</p>
<p><b>path(exact_path_expression)</b> will produce the array
representation of the path expression even if it does not exist in
<b>.</b>, if <b>.</b> is <b>null</b> or an
array or an object.</p>
<p><b>path(pattern)</b> will produce array representations of
the paths matching <b>pattern</b> if the paths exist in
<b>.</b>.</p>
<p>Note that the path expressions are not different from normal
expressions. The expression
<b>path(..|select(type=="boolean"))</b> outputs all the paths
to boolean values in <b>.</b>, and only those paths.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;path(.a[0].b)&#39;
   null
=&gt; [&quot;a&quot;,0,&quot;b&quot;]

jq &#39;[path(..)]&#39;
   {&quot;a&quot;:[{&quot;b&quot;:1}]}
=&gt; [[],[&quot;a&quot;],[&quot;a&quot;,0],[&quot;a&quot;,0,&quot;b&quot;]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>del(path_expression)</h2>
<p>The builtin function <b>del</b> removes a key and its
corresponding value from an object.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;del(.foo)&#39;
   {&quot;foo&quot;: 42, &quot;bar&quot;: 9001, &quot;baz&quot;: 42}
=&gt; {&quot;bar&quot;: 9001, &quot;baz&quot;: 42}

jq &#39;del(.[1, 2])&#39;
   [&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;]
=&gt; [&quot;foo&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>getpath(PATHS)</h2>
<p>The builtin function <b>getpath</b> outputs the values in
<b>.</b> found at each path in <b>PATHS</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;getpath([&quot;a&quot;,&quot;b&quot;])&#39;
   null
=&gt; null

jq &#39;[getpath([&quot;a&quot;,&quot;b&quot;], [&quot;a&quot;,&quot;c&quot;])]&#39;
   {&quot;a&quot;:{&quot;b&quot;:0, &quot;c&quot;:1}}
=&gt; [0, 1]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>setpath(PATHS; VALUE)</h2>
<p>The builtin function <b>setpath</b> sets the
<b>PATHS</b> in <b>.</b> to
<b>VALUE</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;setpath([&quot;a&quot;,&quot;b&quot;]; 1)&#39;
   null
=&gt; {&quot;a&quot;: {&quot;b&quot;: 1}}

jq &#39;setpath([&quot;a&quot;,&quot;b&quot;]; 1)&#39;
   {&quot;a&quot;:{&quot;b&quot;:0}}
=&gt; {&quot;a&quot;: {&quot;b&quot;: 1}}

jq &#39;setpath([0,&quot;a&quot;]; 1)&#39;
   null
=&gt; [{&quot;a&quot;:1}]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>delpaths(PATHS)</h2>
<p>The builtin function <b>delpaths</b> deletes the
<b>PATHS</b> in <b>.</b>. <b>PATHS</b>
must be an array of paths, where each path is an array of strings and
numbers.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;delpaths([[&quot;a&quot;,&quot;b&quot;]])&#39;
   {&quot;a&quot;:{&quot;b&quot;:1},&quot;x&quot;:{&quot;y&quot;:2}}
=&gt; {&quot;a&quot;:{},&quot;x&quot;:{&quot;y&quot;:2}}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>to_entries, from_entries, with_entries(f)</h2>
<p>These functions convert between an object and an array of key-value
pairs. If <b>to_entries</b> is passed an object, then for each
<b>k: v</b> entry in the input, the output array includes
<b>{"key": k, "value": v}</b>.</p>
<p><b>from_entries</b> does the opposite conversion, and
<b>with_entries(f)</b> is a shorthand for <b>to_entries |
map(f) | from_entries</b>, useful for doing some operation to all
keys and values of an object. <b>from_entries</b> accepts
<b>"key"</b>, <b>"Key"</b>, <b>"name"</b>,
<b>"Name"</b>, <b>"value"</b>, and
<b>"Value"</b> as keys.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;to_entries&#39;
   {&quot;a&quot;: 1, &quot;b&quot;: 2}
=&gt; [{&quot;key&quot;:&quot;a&quot;, &quot;value&quot;:1}, {&quot;key&quot;:&quot;b&quot;, &quot;value&quot;:2}]

jq &#39;from_entries&#39;
   [{&quot;key&quot;:&quot;a&quot;, &quot;value&quot;:1}, {&quot;key&quot;:&quot;b&quot;, &quot;value&quot;:2}]
=&gt; {&quot;a&quot;: 1, &quot;b&quot;: 2}

jq &#39;with_entries(.key |= &quot;KEY_&quot; + .)&#39;
   {&quot;a&quot;: 1, &quot;b&quot;: 2}
=&gt; {&quot;KEY_a&quot;: 1, &quot;KEY_b&quot;: 2}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>select(boolean_expression)</h2>
<p>The function <b>select(f)</b> produces its input unchanged
if <b>f</b> returns true for that input, and produces no
output otherwise.</p>
<p>It's useful for filtering lists: <b>[1,2,3] | map(select(. &gt;=
2))</b> will give you <b>[2,3]</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;map(select(. &gt;= 2))&#39;
   [1,5,3,0,7]
=&gt; [5,3,7]

jq &#39;.[] | select(.id == &quot;second&quot;)&#39;
   [{&quot;id&quot;: &quot;first&quot;, &quot;val&quot;: 1}, {&quot;id&quot;: &quot;second&quot;, &quot;val&quot;: 2}]
=&gt; {&quot;id&quot;: &quot;second&quot;, &quot;val&quot;: 2}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>arrays, objects, iterables, booleans, numbers, normals, finites,
strings, nulls, values, scalars</h2>
<p>These built-ins select only inputs that are arrays, objects,
iterables (arrays or objects), booleans, numbers, normal numbers, finite
numbers, strings, null, non-null values, and non-iterables,
respectively.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[]|numbers&#39;
   [[],{},1,&quot;foo&quot;,null,true,false]
=&gt; 1</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>empty</h2>
<p><b>empty</b> returns no results. None at all. Not even
<b>null</b>.</p>
<p>It's useful on occasion. You'll know if you need it :)</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;1, empty, 2&#39;
   null
=&gt; 1, 2

jq &#39;[1,2,empty,3]&#39;
   null
=&gt; [1,2,3]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>error, error(message)</h2>
<p>Produces an error with the input value, or with the message given as
the argument. Errors can be caught with try/catch; see below.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;try error catch .&#39;
   &quot;error message&quot;
=&gt; &quot;error message&quot;

jq &#39;try error(&quot;invalid value: \(.)&quot;) catch .&#39;
   42
=&gt; &quot;invalid value: 42&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>halt</h2>
<p>Stops the jq program with no further outputs. jq will exit with exit
status <b>0</b>.</p>
<h2>halt_error, halt_error(exit_code)</h2>
<p>Stops the jq program with no further outputs. The input will be
printed on <b>stderr</b> as raw output (i.e., strings will not
have double quotes) with no decoration, not even a newline.</p>
<p>The given <b>exit_code</b> (defaulting to
<b>5</b>) will be jq's exit status.</p>
<p>For example, <b>"Error: something went
wrong\n"|halt_error(1)</b>.</p>
<h2>$__loc__</h2>
<p>Produces an object with a "file" key and a "line" key, with the
filename and line number where <b>$__loc__</b> occurs, as
values.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;try error(&quot;\($__loc__)&quot;) catch .&#39;
   null
=&gt; &quot;{\&quot;file\&quot;:\&quot;&lt;top-level&gt;\&quot;,\&quot;line\&quot;:1}&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>paths, paths(node_filter)</h2>
<p><b>paths</b> outputs the paths to all the elements in its
input (except it does not output the empty list, representing .
itself).</p>
<p><b>paths(f)</b> outputs the paths to any values for which
<b>f</b> is <b>true</b>. That is, <b>paths(type
== "number")</b> outputs the paths to all numeric values.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[paths]&#39;
   [1,[[],{&quot;a&quot;:2}]]
=&gt; [[0],[1],[1,0],[1,1],[1,1,&quot;a&quot;]]

jq &#39;[paths(type == &quot;number&quot;)]&#39;
   [1,[[],{&quot;a&quot;:2}]]
=&gt; [[0],[1,1,&quot;a&quot;]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>add</h2>
<p>The filter <b>add</b> takes as input an array, and produces
as output the elements of the array added together. This might mean
summed, concatenated or merged depending on the types of the elements of
the input array - the rules are the same as those for the
<b>+</b> operator (described above).</p>
<p>If the input is an empty array, <b>add</b> returns
<b>null</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;add&#39;
   [&quot;a&quot;,&quot;b&quot;,&quot;c&quot;]
=&gt; &quot;abc&quot;

jq &#39;add&#39;
   [1, 2, 3]
=&gt; 6

jq &#39;add&#39;
   []
=&gt; null</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>any, any(condition), any(generator; condition)</h2>
<p>The filter <b>any</b> takes as input an array of boolean
values, and produces <b>true</b> as output if any of the
elements of the array are <b>true</b>.</p>
<p>If the input is an empty array, <b>any</b> returns
<b>false</b>.</p>
<p>The <b>any(condition)</b> form applies the given condition
to the elements of the input array.</p>
<p>The <b>any(generator; condition)</b> form applies the given
condition to all the outputs of the given generator.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;any&#39;
   [true, false]
=&gt; true

jq &#39;any&#39;
   [false, false]
=&gt; false

jq &#39;any&#39;
   []
=&gt; false</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>all, all(condition), all(generator; condition)</h2>
<p>The filter <b>all</b> takes as input an array of boolean
values, and produces <b>true</b> as output if all of the
elements of the array are <b>true</b>.</p>
<p>The <b>all(condition)</b> form applies the given condition
to the elements of the input array.</p>
<p>The <b>all(generator; condition)</b> form applies the given
condition to all the outputs of the given generator.</p>
<p>If the input is an empty array, <b>all</b> returns
<b>true</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;all&#39;
   [true, false]
=&gt; false

jq &#39;all&#39;
   [true, true]
=&gt; true

jq &#39;all&#39;
   []
=&gt; true</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>flatten, flatten(depth)</h2>
<p>The filter <b>flatten</b> takes as input an array of nested
arrays, and produces a flat array in which all arrays inside the
original array have been recursively replaced by their values. You can
pass an argument to it to specify how many levels of nesting to
flatten.</p>
<p><b>flatten(2)</b> is like <b>flatten</b>, but
going only up to two levels deep.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;flatten&#39;
   [1, [2], [[3]]]
=&gt; [1, 2, 3]

jq &#39;flatten(1)&#39;
   [1, [2], [[3]]]
=&gt; [1, 2, [3]]

jq &#39;flatten&#39;
   [[]]
=&gt; []

jq &#39;flatten&#39;
   [{&quot;foo&quot;: &quot;bar&quot;}, [{&quot;foo&quot;: &quot;baz&quot;}]]
=&gt; [{&quot;foo&quot;: &quot;bar&quot;}, {&quot;foo&quot;: &quot;baz&quot;}]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>range(upto), range(from; upto), range(from; upto; by)</h2>
<p>The <b>range</b> function produces a range of numbers.
<b>range(4; 10)</b> produces 6 numbers, from 4 (inclusive) to
10 (exclusive). The numbers are produced as separate outputs. Use
<b>[range(4; 10)]</b> to get a range as an array.</p>
<p>The one argument form generates numbers from 0 to the given number,
with an increment of 1.</p>
<p>The two argument form generates numbers from <b>from</b> to
<b>upto</b> with an increment of 1.</p>
<p>The three argument form generates numbers <b>from</b> to
<b>upto</b> with an increment of <b>by</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;range(2; 4)&#39;
   null
=&gt; 2, 3

jq &#39;[range(2; 4)]&#39;
   null
=&gt; [2,3]

jq &#39;[range(4)]&#39;
   null
=&gt; [0,1,2,3]

jq &#39;[range(0; 10; 3)]&#39;
   null
=&gt; [0,3,6,9]

jq &#39;[range(0; 10; -1)]&#39;
   null
=&gt; []

jq &#39;[range(0; -5; -1)]&#39;
   null
=&gt; [0,-1,-2,-3,-4]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>floor</h2>
<p>The <b>floor</b> function returns the floor of its numeric
input.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;floor&#39;
   3.14159
=&gt; 3</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>sqrt</h2>
<p>The <b>sqrt</b> function returns the square root of its
numeric input.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;sqrt&#39;
   9
=&gt; 3</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>tonumber</h2>
<p>The <b>tonumber</b> function parses its input as a number.
It will convert correctly-formatted strings to their numeric equivalent,
leave numbers alone, and give an error on all other input.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[] | tonumber&#39;
   [1, &quot;1&quot;]
=&gt; 1, 1</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>tostring</h2>
<p>The <b>tostring</b> function prints its input as a string.
Strings are left unchanged, and all other values are JSON-encoded.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[] | tostring&#39;
   [1, &quot;1&quot;, [1]]
=&gt; &quot;1&quot;, &quot;1&quot;, &quot;[1]&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>type</h2>
<p>The <b>type</b> function returns the type of its argument
as a string, which is one of null, boolean, number, string, array or
object.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;map(type)&#39;
   [0, false, [], {}, null, &quot;hello&quot;]
=&gt; [&quot;number&quot;, &quot;boolean&quot;, &quot;array&quot;, &quot;object&quot;, &quot;null&quot;, &quot;string&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>infinite, nan, isinfinite, isnan, isfinite, isnormal</h2>
<p>Some arithmetic operations can yield infinities and "not a number"
(NaN) values. The <b>isinfinite</b> builtin returns
<b>true</b> if its input is infinite. The
<b>isnan</b> builtin returns <b>true</b> if its
input is a NaN. The <b>infinite</b> builtin returns a positive
infinite value. The <b>nan</b> builtin returns a NaN. The
<b>isnormal</b> builtin returns true if its input is a normal
number.</p>
<p>Note that division by zero raises an error.</p>
<p>Currently most arithmetic operations operating on infinities, NaNs,
and sub-normals do not raise errors.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.[] | (infinite * .) &lt; 0&#39;
   [-1, 1]
=&gt; true, false

jq &#39;infinite, nan | type&#39;
   null
=&gt; &quot;number&quot;, &quot;number&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>sort, sort_by(path_expression)</h2>
<p>The <b>sort</b> functions sorts its input, which must be an
array. Values are sorted in the following order:</p>
<ul>
<li><p><b>null</b></p></li>
<li><p><b>false</b></p></li>
<li><p><b>true</b></p></li>
<li><p>numbers</p></li>
<li><p>strings, in alphabetical order (by unicode codepoint
value)</p></li>
<li><p>arrays, in lexical order</p></li>
<li><p>objects</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The ordering for objects is a little complex: first they're compared
by comparing their sets of keys (as arrays in sorted order), and if
their keys are equal then the values are compared key by key.</p>
<p><b>sort_by</b> may be used to sort by a particular field of
an object, or by applying any jq filter. <b>sort_by(f)</b>
compares two elements by comparing the result of <b>f</b> on
each element. When <b>f</b> produces multiple values, it
firstly compares the first values, and the second values if the first
values are equal, and so on.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;sort&#39;
   [8,3,null,6]
=&gt; [null,3,6,8]

jq &#39;sort_by(.foo)&#39;
   [{&quot;foo&quot;:4, &quot;bar&quot;:10}, {&quot;foo&quot;:3, &quot;bar&quot;:10}, {&quot;foo&quot;:2, &quot;bar&quot;:1}]
=&gt; [{&quot;foo&quot;:2, &quot;bar&quot;:1}, {&quot;foo&quot;:3, &quot;bar&quot;:10}, {&quot;foo&quot;:4, &quot;bar&quot;:10}]

jq &#39;sort_by(.foo, .bar)&#39;
   [{&quot;foo&quot;:4, &quot;bar&quot;:10}, {&quot;foo&quot;:3, &quot;bar&quot;:20}, {&quot;foo&quot;:2, &quot;bar&quot;:1}, {&quot;foo&quot;:3, &quot;bar&quot;:10}]
=&gt; [{&quot;foo&quot;:2, &quot;bar&quot;:1}, {&quot;foo&quot;:3, &quot;bar&quot;:10}, {&quot;foo&quot;:3, &quot;bar&quot;:20}, {&quot;foo&quot;:4, &quot;bar&quot;:10}]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>group_by(path_expression)</h2>
<p><b>group_by(.foo)</b> takes as input an array, groups the
elements having the same <b>.foo</b> field into separate
arrays, and produces all of these arrays as elements of a larger array,
sorted by the value of the <b>.foo</b> field.</p>
<p>Any jq expression, not just a field access, may be used in place of
<b>.foo</b>. The sorting order is the same as described in the
<b>sort</b> function above.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;group_by(.foo)&#39;
   [{&quot;foo&quot;:1, &quot;bar&quot;:10}, {&quot;foo&quot;:3, &quot;bar&quot;:100}, {&quot;foo&quot;:1, &quot;bar&quot;:1}]
=&gt; [[{&quot;foo&quot;:1, &quot;bar&quot;:10}, {&quot;foo&quot;:1, &quot;bar&quot;:1}], [{&quot;foo&quot;:3, &quot;bar&quot;:100}]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>min, max, min_by(path_exp), max_by(path_exp)</h2>
<p>Find the minimum or maximum element of the input array.</p>
<p>The <b>min_by(path_exp)</b> and
<b>max_by(path_exp)</b> functions allow you to specify a
particular field or property to examine, e.g.
<b>min_by(.foo)</b> finds the object with the smallest
<b>foo</b> field.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;min&#39;
   [5,4,2,7]
=&gt; 2

jq &#39;max_by(.foo)&#39;
   [{&quot;foo&quot;:1, &quot;bar&quot;:14}, {&quot;foo&quot;:2, &quot;bar&quot;:3}]
=&gt; {&quot;foo&quot;:2, &quot;bar&quot;:3}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>unique, unique_by(path_exp)</h2>
<p>The <b>unique</b> function takes as input an array and
produces an array of the same elements, in sorted order, with duplicates
removed.</p>
<p>The <b>unique_by(path_exp)</b> function will keep only one
element for each value obtained by applying the argument. Think of it as
making an array by taking one element out of every group produced by
<b>group</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;unique&#39;
   [1,2,5,3,5,3,1,3]
=&gt; [1,2,3,5]

jq &#39;unique_by(.foo)&#39;
   [{&quot;foo&quot;: 1, &quot;bar&quot;: 2}, {&quot;foo&quot;: 1, &quot;bar&quot;: 3}, {&quot;foo&quot;: 4, &quot;bar&quot;: 5}]
=&gt; [{&quot;foo&quot;: 1, &quot;bar&quot;: 2}, {&quot;foo&quot;: 4, &quot;bar&quot;: 5}]

jq &#39;unique_by(length)&#39;
   [&quot;chunky&quot;, &quot;bacon&quot;, &quot;kitten&quot;, &quot;cicada&quot;, &quot;asparagus&quot;]
=&gt; [&quot;bacon&quot;, &quot;chunky&quot;, &quot;asparagus&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>reverse</h2>
<p>This function reverses an array.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;reverse&#39;
   [1,2,3,4]
=&gt; [4,3,2,1]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>contains(element)</h2>
<p>The filter <b>contains(b)</b> will produce true if b is
completely contained within the input. A string B is contained in a
string A if B is a substring of A. An array B is contained in an array A
if all elements in B are contained in any element in A. An object B is
contained in object A if all of the values in B are contained in the
value in A with the same key. All other types are assumed to be
contained in each other if they are equal.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;contains(&quot;bar&quot;)&#39;
   &quot;foobar&quot;
=&gt; true

jq &#39;contains([&quot;baz&quot;, &quot;bar&quot;])&#39;
   [&quot;foobar&quot;, &quot;foobaz&quot;, &quot;blarp&quot;]
=&gt; true

jq &#39;contains([&quot;bazzzzz&quot;, &quot;bar&quot;])&#39;
   [&quot;foobar&quot;, &quot;foobaz&quot;, &quot;blarp&quot;]
=&gt; false

jq &#39;contains({foo: 12, bar: [{barp: 12}]})&#39;
   {&quot;foo&quot;: 12, &quot;bar&quot;:[1,2,{&quot;barp&quot;:12, &quot;blip&quot;:13}]}
=&gt; true

jq &#39;contains({foo: 12, bar: [{barp: 15}]})&#39;
   {&quot;foo&quot;: 12, &quot;bar&quot;:[1,2,{&quot;barp&quot;:12, &quot;blip&quot;:13}]}
=&gt; false</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>indices(s)</h2>
<p>Outputs an array containing the indices in <b>.</b> where
<b>s</b> occurs. The input may be an array, in which case if
<b>s</b> is an array then the indices output will be those
where all elements in <b>.</b> match those of
<b>s</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;indices(&quot;, &quot;)&#39;
   &quot;a,b, cd, efg, hijk&quot;
=&gt; [3,7,12]

jq &#39;indices(1)&#39;
   [0,1,2,1,3,1,4]
=&gt; [1,3,5]

jq &#39;indices([1,2])&#39;
   [0,1,2,3,1,4,2,5,1,2,6,7]
=&gt; [1,8]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>index(s), rindex(s)</h2>
<p>Outputs the index of the first (<b>index</b>) or last
(<b>rindex</b>) occurrence of <b>s</b> in the
input.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;index(&quot;, &quot;)&#39;
   &quot;a,b, cd, efg, hijk&quot;
=&gt; 3

jq &#39;index(1)&#39;
   [0,1,2,1,3,1,4]
=&gt; 1

jq &#39;index([1,2])&#39;
   [0,1,2,3,1,4,2,5,1,2,6,7]
=&gt; 1

jq &#39;rindex(&quot;, &quot;)&#39;
   &quot;a,b, cd, efg, hijk&quot;
=&gt; 12

jq &#39;rindex(1)&#39;
   [0,1,2,1,3,1,4]
=&gt; 5

jq &#39;rindex([1,2])&#39;
   [0,1,2,3,1,4,2,5,1,2,6,7]
=&gt; 8</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>inside</h2>
<p>The filter <b>inside(b)</b> will produce true if the input
is completely contained within b. It is, essentially, an inversed
version of <b>contains</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;inside(&quot;foobar&quot;)&#39;
   &quot;bar&quot;
=&gt; true

jq &#39;inside([&quot;foobar&quot;, &quot;foobaz&quot;, &quot;blarp&quot;])&#39;
   [&quot;baz&quot;, &quot;bar&quot;]
=&gt; true

jq &#39;inside([&quot;foobar&quot;, &quot;foobaz&quot;, &quot;blarp&quot;])&#39;
   [&quot;bazzzzz&quot;, &quot;bar&quot;]
=&gt; false

jq &#39;inside({&quot;foo&quot;: 12, &quot;bar&quot;:[1,2,{&quot;barp&quot;:12, &quot;blip&quot;:13}]})&#39;
   {&quot;foo&quot;: 12, &quot;bar&quot;: [{&quot;barp&quot;: 12}]}
=&gt; true

jq &#39;inside({&quot;foo&quot;: 12, &quot;bar&quot;:[1,2,{&quot;barp&quot;:12, &quot;blip&quot;:13}]})&#39;
   {&quot;foo&quot;: 12, &quot;bar&quot;: [{&quot;barp&quot;: 15}]}
=&gt; false</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>startswith(str)</h2>
<p>Outputs <b>true</b> if . starts with the given string
argument.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.[]|startswith(&quot;foo&quot;)]&#39;
   [&quot;fo&quot;, &quot;foo&quot;, &quot;barfoo&quot;, &quot;foobar&quot;, &quot;barfoob&quot;]
=&gt; [false, true, false, true, false]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>endswith(str)</h2>
<p>Outputs <b>true</b> if . ends with the given string
argument.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.[]|endswith(&quot;foo&quot;)]&#39;
   [&quot;foobar&quot;, &quot;barfoo&quot;]
=&gt; [false, true]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>combinations, combinations(n)</h2>
<p>Outputs all combinations of the elements of the arrays in the input
array. If given an argument <b>n</b>, it outputs all
combinations of <b>n</b> repetitions of the input array.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;combinations&#39;
   [[1,2], [3, 4]]
=&gt; [1, 3], [1, 4], [2, 3], [2, 4]

jq &#39;combinations(2)&#39;
   [0, 1]
=&gt; [0, 0], [0, 1], [1, 0], [1, 1]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>ltrimstr(str)</h2>
<p>Outputs its input with the given prefix string removed, if it starts
with it.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.[]|ltrimstr(&quot;foo&quot;)]&#39;
   [&quot;fo&quot;, &quot;foo&quot;, &quot;barfoo&quot;, &quot;foobar&quot;, &quot;afoo&quot;]
=&gt; [&quot;fo&quot;,&quot;&quot;,&quot;barfoo&quot;,&quot;bar&quot;,&quot;afoo&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>rtrimstr(str)</h2>
<p>Outputs its input with the given suffix string removed, if it ends
with it.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.[]|rtrimstr(&quot;foo&quot;)]&#39;
   [&quot;fo&quot;, &quot;foo&quot;, &quot;barfoo&quot;, &quot;foobar&quot;, &quot;foob&quot;]
=&gt; [&quot;fo&quot;,&quot;&quot;,&quot;bar&quot;,&quot;foobar&quot;,&quot;foob&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>explode</h2>
<p>Converts an input string into an array of the string's codepoint
numbers.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;explode&#39;
   &quot;foobar&quot;
=&gt; [102,111,111,98,97,114]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>implode</h2>
<p>The inverse of explode.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;implode&#39;
   [65, 66, 67]
=&gt; &quot;ABC&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>split(str)</h2>
<p>Splits an input string on the separator argument.</p>
<p><b>split</b> can also split on regex matches when called
with two arguments (see the regular expressions section below).</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;split(&quot;, &quot;)&#39;
   &quot;a, b,c,d, e, &quot;
=&gt; [&quot;a&quot;,&quot;b,c,d&quot;,&quot;e&quot;,&quot;&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>join(str)</h2>
<p>Joins the array of elements given as input, using the argument as
separator. It is the inverse of <b>split</b>: that is, running
<b>split("foo") | join("foo")</b> over any input string
returns said input string.</p>
<p>Numbers and booleans in the input are converted to strings. Null
values are treated as empty strings. Arrays and objects in the input are
not supported.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;join(&quot;, &quot;)&#39;
   [&quot;a&quot;,&quot;b,c,d&quot;,&quot;e&quot;]
=&gt; &quot;a, b,c,d, e&quot;

jq &#39;join(&quot; &quot;)&#39;
   [&quot;a&quot;,1,2.3,true,null,false]
=&gt; &quot;a 1 2.3 true  false&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>ascii_downcase, ascii_upcase</h2>
<p>Emit a copy of the input string with its alphabetic characters (a-z
and A-Z) converted to the specified case.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;ascii_upcase&#39;
   &quot;useful but not for é&quot;
=&gt; &quot;USEFUL BUT NOT FOR é&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>while(cond; update)</h2>
<p>The <b>while(cond; update)</b> function allows you to
repeatedly apply an update to <b>.</b> until
<b>cond</b> is false.</p>
<p>Note that <b>while(cond; update)</b> is internally defined
as a recursive jq function. Recursive calls within
<b>while</b> will not consume additional memory if
<b>update</b> produces at most one output for each input. See
advanced topics below.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[while(.&lt;100; .*2)]&#39;
   1
=&gt; [1,2,4,8,16,32,64]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>repeat(exp)</h2>
<p>The <b>repeat(exp)</b> function allows you to repeatedly
apply expression <b>exp</b> to <b>.</b> until an
error is raised.</p>
<p>Note that <b>repeat(exp)</b> is internally defined as a
recursive jq function. Recursive calls within <b>repeat</b>
will not consume additional memory if <b>exp</b> produces at
most one output for each input. See advanced topics below.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[repeat(.*2, error)?]&#39;
   1
=&gt; [2]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>until(cond; next)</h2>
<p>The <b>until(cond; next)</b> function allows you to
repeatedly apply the expression <b>next</b>, initially to
<b>.</b> then to its own output, until <b>cond</b>
is true. For example, this can be used to implement a factorial function
(see below).</p>
<p>Note that <b>until(cond; next)</b> is internally defined as
a recursive jq function. Recursive calls within <b>until()</b>
will not consume additional memory if <b>next</b> produces at
most one output for each input. See advanced topics below.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.,1]|until(.[0] &lt; 1; [.[0] - 1, .[1] * .[0]])|.[1]&#39;
   4
=&gt; 24</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>recurse(f), recurse, recurse(f; condition)</h2>
<p>The <b>recurse(f)</b> function allows you to search through
a recursive structure, and extract interesting data from all levels.
Suppose your input represents a filesystem:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;name&quot;: &quot;/&quot;, &quot;children&quot;: [
  {&quot;name&quot;: &quot;/bin&quot;, &quot;children&quot;: [
    {&quot;name&quot;: &quot;/bin/ls&quot;, &quot;children&quot;: []},
    {&quot;name&quot;: &quot;/bin/sh&quot;, &quot;children&quot;: []}]},
  {&quot;name&quot;: &quot;/home&quot;, &quot;children&quot;: [
    {&quot;name&quot;: &quot;/home/stephen&quot;, &quot;children&quot;: [
      {&quot;name&quot;: &quot;/home/stephen/jq&quot;, &quot;children&quot;: []}]}]}]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Now suppose you want to extract all of the filenames present. You
need to retrieve <b>.name</b>,
<b>.children[].name</b>,
<b>.children[].children[].name</b>, and so on. You can do this
with:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
recurse(.children[]) | .name</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>When called without an argument, <b>recurse</b> is
equivalent to <b>recurse(.[]?)</b>.</p>
<p><b>recurse(f)</b> is identical to <b>recurse(f;
true)</b> and can be used without concerns about recursion
depth.</p>
<p><b>recurse(f; condition)</b> is a generator which begins by
emitting . and then emits in turn .|f, .|f|f, .|f|f|f, ... so long as
the computed value satisfies the condition. For example, to generate all
the integers, at least in principle, one could write
<b>recurse(.+1; true)</b>.</p>
<p>The recursive calls in <b>recurse</b> will not consume
additional memory whenever <b>f</b> produces at most a single
output for each input.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;recurse(.foo[])&#39;
   {&quot;foo&quot;:[{&quot;foo&quot;: []}, {&quot;foo&quot;:[{&quot;foo&quot;:[]}]}]}
=&gt; {&quot;foo&quot;:[{&quot;foo&quot;:[]},{&quot;foo&quot;:[{&quot;foo&quot;:[]}]}]}, {&quot;foo&quot;:[]}, {&quot;foo&quot;:[{&quot;foo&quot;:[]}]}, {&quot;foo&quot;:[]}

jq &#39;recurse&#39;
   {&quot;a&quot;:0,&quot;b&quot;:[1]}
=&gt; {&quot;a&quot;:0,&quot;b&quot;:[1]}, 0, [1], 1

jq &#39;recurse(. * .; . &lt; 20)&#39;
   2
=&gt; 2, 4, 16</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>walk(f)</h2>
<p>The <b>walk(f)</b> function applies f recursively to every
component of the input entity. When an array is encountered, f is first
applied to its elements and then to the array itself; when an object is
encountered, f is first applied to all the values and then to the
object. In practice, f will usually test the type of its input, as
illustrated in the following examples. The first example highlights the
usefulness of processing the elements of an array of arrays before
processing the array itself. The second example shows how all the keys
of all the objects within the input can be considered for
alteration.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;walk(if type == &quot;array&quot; then sort else . end)&#39;
   [[4, 1, 7], [8, 5, 2], [3, 6, 9]]
=&gt; [[1,4,7],[2,5,8],[3,6,9]]

jq &#39;walk( if type == &quot;object&quot; then with_entries( .key |= sub( &quot;^_+&quot;; &quot;&quot;) ) else . end )&#39;
   [ { &quot;_a&quot;: { &quot;__b&quot;: 2 } } ]
=&gt; [{&quot;a&quot;:{&quot;b&quot;:2}}]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>$JQ_BUILD_CONFIGURATION</h2>
<p>This builtin binding shows the jq executable's build configuration.
Its value has no particular format, but it can be expected to be at
least the <b>./configure</b> command-line arguments, and may
be enriched in the future to include the version strings for the build
tooling used.</p>
<p>Note that this can be overriden in the command-line with
<b>--arg</b> and related options.</p>
<h2>$ENV, env</h2>
<p><b>$ENV</b> is an object representing the environment
variables as set when the jq program started.</p>
<p><b>env</b> outputs an object representing jq's current
environment.</p>
<p>At the moment there is no builtin for setting environment
variables.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;$ENV.PAGER&#39;
   null
=&gt; &quot;less&quot;

jq &#39;env.PAGER&#39;
   null
=&gt; &quot;less&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>transpose</h2>
<p>Transpose a possibly jagged matrix (an array of arrays). Rows are
padded with nulls so the result is always rectangular.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;transpose&#39;
   [[1], [2,3]]
=&gt; [[1,2],[null,3]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>bsearch(x)</h2>
<p><b>bsearch(x)</b> conducts a binary search for x in the
input array. If the input is sorted and contains x, then
<b>bsearch(x)</b> will return its index in the array;
otherwise, if the array is sorted, it will return (-1 - ix) where ix is
an insertion point such that the array would still be sorted after the
insertion of x at ix. If the array is not sorted,
<b>bsearch(x)</b> will return an integer that is probably of
no interest.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;bsearch(0)&#39;
   [0,1]
=&gt; 0

jq &#39;bsearch(0)&#39;
   [1,2,3]
=&gt; -1

jq &#39;bsearch(4) as $ix | if $ix &lt; 0 then .[-(1+$ix)] = 4 else . end&#39;
   [1,2,3]
=&gt; [1,2,3,4]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>String interpolation: \(exp)</h2>
<p>Inside a string, you can put an expression inside parens after a
backslash. Whatever the expression returns will be interpolated into the
string.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;&quot;The input was \(.), which is one less than \(.+1)&quot;&#39;
   42
=&gt; &quot;The input was 42, which is one less than 43&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Convert to/from JSON</h2>
<p>The <b>tojson</b> and <b>fromjson</b> builtins
dump values as JSON texts or parse JSON texts into values, respectively.
The <b>tojson</b> builtin differs from
<b>tostring</b> in that <b>tostring</b> returns
strings unmodified, while <b>tojson</b> encodes strings as
JSON strings.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.[]|tostring]&#39;
   [1, &quot;foo&quot;, [&quot;foo&quot;]]
=&gt; [&quot;1&quot;,&quot;foo&quot;,&quot;[\&quot;foo\&quot;]&quot;]

jq &#39;[.[]|tojson]&#39;
   [1, &quot;foo&quot;, [&quot;foo&quot;]]
=&gt; [&quot;1&quot;,&quot;\&quot;foo\&quot;&quot;,&quot;[\&quot;foo\&quot;]&quot;]

jq &#39;[.[]|tojson|fromjson]&#39;
   [1, &quot;foo&quot;, [&quot;foo&quot;]]
=&gt; [1,&quot;foo&quot;,[&quot;foo&quot;]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Format strings and escaping</h2>
<p>The <b>@foo</b> syntax is used to format and escape
strings, which is useful for building URLs, documents in a language like
HTML or XML, and so forth. <b>@foo</b> can be used as a filter
on its own, the possible escapings are:</p>
<dl>
<dt><b>@text</b>:</dt>
<dd>
<p>Calls <b>tostring</b>, see that function for details.</p>
</dd>
<dt><b>@json</b>:</dt>
<dd>
<p>Serializes the input as JSON.</p>
</dd>
<dt><b>@html</b>:</dt>
<dd>
<p>Applies HTML/XML escaping, by mapping the characters
<b>&lt;&gt;&amp;'"</b> to their entity equivalents
<b>&amp;lt;</b>, <b>&amp;gt;</b>,
<b>&amp;amp;</b>, <b>&amp;apos;</b>,
<b>&amp;quot;</b>.</p>
</dd>
<dt><b>@uri</b>:</dt>
<dd>
<p>Applies percent-encoding, by mapping all reserved URI characters to a
<b>%XX</b> sequence.</p>
</dd>
<dt><b>@csv</b>:</dt>
<dd>
<p>The input must be an array, and it is rendered as CSV with double
quotes for strings, and quotes escaped by repetition.</p>
</dd>
<dt><b>@tsv</b>:</dt>
<dd>
<p>The input must be an array, and it is rendered as TSV (tab-separated
values). Each input array will be printed as a single line. Fields are
separated by a single tab (ascii <b>0x09</b>). Input
characters line-feed (ascii <b>0x0a</b>), carriage-return
(ascii <b>0x0d</b>), tab (ascii <b>0x09</b>) and
backslash (ascii <b>0x5c</b>) will be output as escape
sequences <b>\n</b>, <b>\r</b>, <b>\t</b>,
<b>\\</b> respectively.</p>
</dd>
<dt><b>@sh</b>:</dt>
<dd>
<p>The input is escaped suitable for use in a command-line for a POSIX
shell. If the input is an array, the output will be a series of
space-separated strings.</p>
</dd>
<dt><b>@base64</b>:</dt>
<dd>
<p>The input is converted to base64 as specified by RFC 4648.</p>
</dd>
<dt><b>@base64d</b>:</dt>
<dd>
<p>The inverse of <b>@base64</b>, input is decoded as
specified by RFC 4648. Note\: If the decoded string is not UTF-8, the
results are undefined.</p>
</dd>
</dl>
<p>This syntax can be combined with string interpolation in a useful
way. You can follow a <b>@foo</b> token with a string literal.
The contents of the string literal will <em>not</em> be escaped.
However, all interpolations made inside that string literal will be
escaped. For instance,</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
@uri &quot;https://www.google.com/search?q=\(.search)&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>will produce the following output for the input
<b>{"search":"what is jq?"}</b>:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
&quot;https://www.google.com/search?q=what%20is%20jq%3F&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Note that the slashes, question mark, etc. in the URL are not
escaped, as they were part of the string literal.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;@html&#39;
   &quot;This works if x &lt; y&quot;
=&gt; &quot;This works if x &amp;lt; y&quot;

jq &#39;@sh &quot;echo \(.)&quot;&#39;
   &quot;O&#39;Hara&#39;s Ale&quot;
=&gt; &quot;echo &#39;O&#39;\\&#39;&#39;Hara&#39;\\&#39;&#39;s Ale&#39;&quot;

jq &#39;@base64&#39;
   &quot;This is a message&quot;
=&gt; &quot;VGhpcyBpcyBhIG1lc3NhZ2U=&quot;

jq &#39;@base64d&#39;
   &quot;VGhpcyBpcyBhIG1lc3NhZ2U=&quot;
=&gt; &quot;This is a message&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Dates</h2>
<p>jq provides some basic date handling functionality, with some
high-level and low-level builtins. In all cases these builtins deal
exclusively with time in UTC.</p>
<p>The <b>fromdateiso8601</b> builtin parses datetimes in the
ISO 8601 format to a number of seconds since the Unix epoch
(1970-01-01T00:00:00Z). The <b>todateiso8601</b> builtin does
the inverse.</p>
<p>The <b>fromdate</b> builtin parses datetime strings.
Currently <b>fromdate</b> only supports ISO 8601 datetime
strings, but in the future it will attempt to parse datetime strings in
more formats.</p>
<p>The <b>todate</b> builtin is an alias for
<b>todateiso8601</b>.</p>
<p>The <b>now</b> builtin outputs the current time, in seconds
since the Unix epoch.</p>
<p>Low-level jq interfaces to the C-library time functions are also
provided: <b>strptime</b>, <b>strftime</b>,
<b>strflocaltime</b>, <b>mktime</b>,
<b>gmtime</b>, and <b>localtime</b>. Refer to your
host operating system's documentation for the format strings used by
<b>strptime</b> and <b>strftime</b>. Note: these are
not necessarily stable interfaces in jq, particularly as to their
localization functionality.</p>
<p>The <b>gmtime</b> builtin consumes a number of seconds
since the Unix epoch and outputs a "broken down time" representation of
Greenwich Mean Time as an array of numbers representing (in this order):
the year, the month (zero-based), the day of the month (one-based), the
hour of the day, the minute of the hour, the second of the minute, the
day of the week, and the day of the year -- all one-based unless
otherwise stated. The day of the week number may be wrong on some
systems for dates before March 1st 1900, or after December 31 2099.</p>
<p>The <b>localtime</b> builtin works like the
<b>gmtime</b> builtin, but using the local timezone
setting.</p>
<p>The <b>mktime</b> builtin consumes "broken down time"
representations of time output by <b>gmtime</b> and
<b>strptime</b>.</p>
<p>The <b>strptime(fmt)</b> builtin parses input strings
matching the <b>fmt</b> argument. The output is in the "broken
down time" representation consumed by <b>gmtime</b> and output
by <b>mktime</b>.</p>
<p>The <b>strftime(fmt)</b> builtin formats a time (GMT) with
the given format. The <b>strflocaltime</b> does the same, but
using the local timezone setting.</p>
<p>The format strings for <b>strptime</b> and
<b>strftime</b> are described in typical C library
documentation. The format string for ISO 8601 datetime is
<b>"%Y-%m-%dT%H:%M:%SZ"</b>.</p>
<p>jq may not support some or all of this date functionality on some
systems. In particular, the <b>%u</b> and <b>%j</b>
specifiers for <b>strptime(fmt)</b> are not supported on
macOS.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;fromdate&#39;
   &quot;2015-03-05T23:51:47Z&quot;
=&gt; 1425599507

jq &#39;strptime(&quot;%Y-%m-%dT%H:%M:%SZ&quot;)&#39;
   &quot;2015-03-05T23:51:47Z&quot;
=&gt; [2015,2,5,23,51,47,4,63]

jq &#39;strptime(&quot;%Y-%m-%dT%H:%M:%SZ&quot;)|mktime&#39;
   &quot;2015-03-05T23:51:47Z&quot;
=&gt; 1425599507</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>SQL-Style Operators</h2>
<p>jq provides a few SQL-style operators.</p>
<dl>
<dt>INDEX(stream; index_expression):</dt>
<dd>
<p>This builtin produces an object whose keys are computed by the given
index expression applied to each value from the given stream.</p>
</dd>
<dt>JOIN($idx; stream; idx_expr; join_expr):</dt>
<dd>
<p>This builtin joins the values from the given stream to the given
index. The index's keys are computed by applying the given index
expression to each value from the given stream. An array of the value in
the stream and the corresponding value from the index is fed to the
given join expression to produce each result.</p>
</dd>
<dt>JOIN($idx; stream; idx_expr):</dt>
<dd>
<p>Same as <b>JOIN($idx; stream; idx_expr; .)</b>.</p>
</dd>
<dt>JOIN($idx; idx_expr):</dt>
<dd>
<p>This builtin joins the input <b>.</b> to the given index,
applying the given index expression to <b>.</b> to compute the
index key. The join operation is as described above.</p>
</dd>
<dt>IN(s):</dt>
<dd>
<p>This builtin outputs <b>true</b> if <b>.</b>
appears in the given stream, otherwise it outputs
<b>false</b>.</p>
</dd>
<dt>IN(source; s):</dt>
<dd>
<p>This builtin outputs <b>true</b> if any value in the source
stream appears in the second stream, otherwise it outputs
<b>false</b>.</p>
</dd>
</dl>
<h2>builtins</h2>
<p>Returns a list of all builtin functions in the format
<b>name/arity</b>. Since functions with the same name but
different arities are considered separate functions,
<b>all/0</b>, <b>all/1</b>, and
<b>all/2</b> would all be present in the list.</p>


title: CONDITIONALS AND COMPARISONS
content:
<h2>==, !=</h2>
<p>The expression 'a == b' will produce 'true' if the results of
evaluating a and b are equal (that is, if they represent equivalent JSON
values) and 'false' otherwise. In particular, strings are never
considered equal to numbers. In checking for the equality of JSON
objects, the ordering of keys is irrelevant. If you're coming from
JavaScript, please note that jq's <b>==</b> is like
JavaScript's <b>===</b>, the "strict equality" operator.</p>
<p>!= is "not equal", and 'a != b' returns the opposite value of 'a ==
b'</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;. == false&#39;
   null
=&gt; false

jq &#39;. == {&quot;b&quot;: {&quot;d&quot;: (4 + 1e-20), &quot;c&quot;: 3}, &quot;a&quot;:1}&#39;
   {&quot;a&quot;:1, &quot;b&quot;: {&quot;c&quot;: 3, &quot;d&quot;: 4}}
=&gt; true

jq &#39;.[] == 1&#39;
   [1, 1.0, &quot;1&quot;, &quot;banana&quot;]
=&gt; true, true, false, false</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>if-then-else-end</h2>
<p><b>if A then B else C end</b> will act the same as
<b>B</b> if <b>A</b> produces a value other than
false or null, but act the same as <b>C</b> otherwise.</p>
<p><b>if A then B end</b> is the same as <b>if A then B
else . end</b>. That is, the <b>else</b> branch is
optional, and if absent is the same as <b>.</b>. This also
applies to <b>elif</b> with absent ending
<b>else</b> branch.</p>
<p>Checking for false or null is a simpler notion of "truthiness" than
is found in JavaScript or Python, but it means that you'll sometimes
have to be more explicit about the condition you want. You can't test
whether, e.g. a string is empty using <b>if .name then A else B
end</b>; you'll need something like <b>if .name == "" then A
else B end</b> instead.</p>
<p>If the condition <b>A</b> produces multiple results, then
<b>B</b> is evaluated once for each result that is not false
or null, and <b>C</b> is evaluated once for each false or
null.</p>
<p>More cases can be added to an if using <b>elif A then B</b>
syntax.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;if . == 0 then
  &quot;zero&quot;
elif . == 1 then
  &quot;one&quot;
else
  &quot;many&quot;
end&#39;
   2
=&gt; &quot;many&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>&gt;, &gt;=, &lt;=, &lt;</h2>
<p>The comparison operators <b>&gt;</b>,
<b>&gt;=</b>, <b>&lt;=</b>, <b>&lt;</b>
return whether their left argument is greater than, greater than or
equal to, less than or equal to or less than their right argument
(respectively).</p>
<p>The ordering is the same as that described for <b>sort</b>,
above.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;. &lt; 5&#39;
   2
=&gt; true</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>and, or, not</h2>
<p>jq supports the normal Boolean operators <b>and</b>,
<b>or</b>, <b>not</b>. They have the same standard
of truth as if expressions - <b>false</b> and
<b>null</b> are considered "false values", and anything else
is a "true value".</p>
<p>If an operand of one of these operators produces multiple results,
the operator itself will produce a result for each input.</p>
<p><b>not</b> is in fact a builtin function rather than an
operator, so it is called as a filter to which things can be piped
rather than with special syntax, as in <b>.foo and .bar |
not</b>.</p>
<p>These three only produce the values <b>true</b> and
<b>false</b>, and so are only useful for genuine Boolean
operations, rather than the common Perl/Python/Ruby idiom of
"value_that_may_be_null or default". If you want to use this form of
"or", picking between two values rather than evaluating a condition, see
the <b>//</b> operator below.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;42 and &quot;a string&quot;&#39;
   null
=&gt; true

jq &#39;(true, false) or false&#39;
   null
=&gt; true, false

jq &#39;(true, true) and (true, false)&#39;
   null
=&gt; true, false, true, false

jq &#39;[true, false | not]&#39;
   null
=&gt; [false, true]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Alternative operator: //</h2>
<p>The <b>//</b> operator produces all the values of its
left-hand side that are neither <b>false</b> nor
<b>null</b>, or, if the left-hand side produces no values
other than <b>false</b> or <b>null</b>, then
<b>//</b> produces all the values of its right-hand side.</p>
<p>A filter of the form <b>a // b</b> produces all the results
of <b>a</b> that are not <b>false</b> or
<b>null</b>. If <b>a</b> produces no results, or no
results other than <b>false</b> or <b>null</b>, then
<b>a // b</b> produces the results of <b>b</b>.</p>
<p>This is useful for providing defaults: <b>.foo // 1</b>
will evaluate to <b>1</b> if there's no <b>.foo</b>
element in the input. It's similar to how <b>or</b> is
sometimes used in Python (jq's <b>or</b> operator is reserved
for strictly Boolean operations).</p>
<p>Note: <b>some_generator // defaults_here</b> is not the
same as <b>some_generator | . // defaults_here</b>. The latter
will produce default values for all non-<b>false</b>,
non-<b>null</b> values of the left-hand side, while the former
will not. Precedence rules can make this confusing. For example, in
<b>false, 1 // 2</b> the left-hand side of <b>//</b>
is <b>1</b>, not <b>false, 1</b> -- <b>false, 1
// 2</b> parses the same way as <b>false, (1 // 2)</b>.
In <b>(false, null, 1) | . // 42</b> the left-hand side of
<b>//</b> is <b>.</b>, which always produces just
one value, while in <b>(false, null, 1) // 42</b> the
left-hand side is a generator of three values, and since it produces a
value other <b>false</b> and <b>null</b>, the
default <b>42</b> is not produced.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;empty // 42&#39;
   null
=&gt; 42

jq &#39;.foo // 42&#39;
   {&quot;foo&quot;: 19}
=&gt; 19

jq &#39;.foo // 42&#39;
   {}
=&gt; 42

jq &#39;(false, null, 1) // 42&#39;
   null
=&gt; 1

jq &#39;(false, null, 1) | . // 42&#39;
   null
=&gt; 42, 42, 1</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>try-catch</h2>
<p>Errors can be caught by using <b>try EXP catch EXP</b>. The
first expression is executed, and if it fails then the second is
executed with the error message. The output of the handler, if any, is
output as if it had been the output of the expression to try.</p>
<p>The <b>try EXP</b> form uses <b>empty</b> as the
exception handler.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;try .a catch &quot;. is not an object&quot;&#39;
   true
=&gt; &quot;. is not an object&quot;

jq &#39;[.[]|try .a]&#39;
   [{}, true, {&quot;a&quot;:1}]
=&gt; [null, 1]

jq &#39;try error(&quot;some exception&quot;) catch .&#39;
   true
=&gt; &quot;some exception&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Breaking out of control structures</h2>
<p>A convenient use of try/catch is to break out of control structures
like <b>reduce</b>, <b>foreach</b>,
<b>while</b>, and so on.</p>
<p>For example:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
# Repeat an expression until it raises &quot;break&quot; as an
# error, then stop repeating without re-raising the error.
# But if the error caught is not &quot;break&quot; then re-raise it.
try repeat(exp) catch if .==&quot;break&quot; then empty else error</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>jq has a syntax for named lexical labels to "break" or "go (back)
to":</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
label $out | ... break $out ...</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The <b>break $label_name</b> expression will cause the
program to to act as though the nearest (to the left) <b>label
$label_name</b> produced <b>empty</b>.</p>
<p>The relationship between the <b>break</b> and corresponding
<b>label</b> is lexical: the label has to be "visible" from
the break.</p>
<p>To break out of a <b>reduce</b>, for example:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
label $out | reduce .[] as $item (null; if .==false then break $out else ... end)</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The following jq program produces a syntax error:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
break $out</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>because no label <b>$out</b> is visible.</p>
<h2>Error Suppression / Optional Operator: ?</h2>
<p>The <b>?</b> operator, used as <b>EXP?</b>, is
shorthand for <b>try EXP</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[.[] | .a?]&#39;
   [{}, true, {&quot;a&quot;:1}]
=&gt; [null, 1]

jq &#39;[.[] | tonumber?]&#39;
   [&quot;1&quot;, &quot;invalid&quot;, &quot;3&quot;, 4]
=&gt; [1, 3, 4]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: REGULAR EXPRESSIONS
content:
<p>jq uses the</p>
<p>Oniguruma supports several flavors of regular expression, so it is
important to know that jq uses the</p>
<p>The jq regex filters are defined so that they can be used using one
of these patterns:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
STRING | FILTER(REGEX)
STRING | FILTER(REGEX; FLAGS)
STRING | FILTER([REGEX])
STRING | FILTER([REGEX, FLAGS])</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>where:</p>
<ul>
<li><p>STRING, REGEX, and FLAGS are jq strings and subject to jq string
interpolation;</p></li>
<li><p>REGEX, after string interpolation, should be a valid regular
expression;</p></li>
<li><p>FILTER is one of <b>test</b>, <b>match</b>,
or <b>capture</b>, as described below.</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Since REGEX must evaluate to a JSON string, some characters that are
needed to form a regular expression must be escaped. For example, the
regular expression <b>\s</b> signifying a whitespace character
would be written as <b>"\\s"</b>.</p>
<p>FLAGS is a string consisting of one of more of the supported
flags:</p>
<ul>
<li><p><b>g</b> - Global search (find all matches, not just
the first)</p></li>
<li><p><b>i</b> - Case insensitive search</p></li>
<li><p><b>m</b> - Multi line mode (<b>.</b> will
match newlines)</p></li>
<li><p><b>n</b> - Ignore empty matches</p></li>
<li><p><b>p</b> - Both s and m modes are enabled</p></li>
<li><p><b>s</b> - Single line mode (<b>^</b> -&gt;
<b>\A</b>, <b>$</b> -&gt;
<b>\Z</b>)</p></li>
<li><p><b>l</b> - Find longest possible matches</p></li>
<li><p><b>x</b> - Extended regex format (ignore whitespace and
comments)</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>To match a whitespace with the <b>x</b> flag, use
<b>\s</b>, e.g.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq -n &#39;&quot;a b&quot; | test(&quot;a\\sb&quot;; &quot;x&quot;)&#39;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Note that certain flags may also be specified within REGEX, e.g.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq -n &#39;(&quot;test&quot;, &quot;TEst&quot;, &quot;teST&quot;, &quot;TEST&quot;) | test(&quot;(?i)te(?-i)st&quot;)&#39;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>evaluates to: <b>true</b>, <b>true</b>,
<b>false</b>, <b>false</b>.</p>
<h2>test(val), test(regex; flags)</h2>
<p>Like <b>match</b>, but does not return match objects, only
<b>true</b> or <b>false</b> for whether or not the
regex matches the input.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;test(&quot;foo&quot;)&#39;
   &quot;foo&quot;
=&gt; true

jq &#39;.[] | test(&quot;a b c # spaces are ignored&quot;; &quot;ix&quot;)&#39;
   [&quot;xabcd&quot;, &quot;ABC&quot;]
=&gt; true, true</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>match(val), match(regex; flags)</h2>
<p><b>match</b> outputs an object for each match it finds.
Matches have the following fields:</p>
<ul>
<li><p><b>offset</b> - offset in UTF-8 codepoints from the
beginning of the input</p></li>
<li><p><b>length</b> - length in UTF-8 codepoints of the
match</p></li>
<li><p><b>string</b> - the string that it matched</p></li>
<li><p><b>captures</b> - an array of objects representing
capturing groups.</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Capturing group objects have the following fields:</p>
<ul>
<li><p><b>offset</b> - offset in UTF-8 codepoints from the
beginning of the input</p></li>
<li><p><b>length</b> - length in UTF-8 codepoints of this
capturing group</p></li>
<li><p><b>string</b> - the string that was captured</p></li>
<li><p><b>name</b> - the name of the capturing group (or
<b>null</b> if it was unnamed)</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Capturing groups that did not match anything return an offset of
-1</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;match(&quot;(abc)+&quot;; &quot;g&quot;)&#39;
   &quot;abc abc&quot;
=&gt; {&quot;offset&quot;: 0, &quot;length&quot;: 3, &quot;string&quot;: &quot;abc&quot;, &quot;captures&quot;: [{&quot;offset&quot;: 0, &quot;length&quot;: 3, &quot;string&quot;: &quot;abc&quot;, &quot;name&quot;: null}]}, {&quot;offset&quot;: 4, &quot;length&quot;: 3, &quot;string&quot;: &quot;abc&quot;, &quot;captures&quot;: [{&quot;offset&quot;: 4, &quot;length&quot;: 3, &quot;string&quot;: &quot;abc&quot;, &quot;name&quot;: null}]}

jq &#39;match(&quot;foo&quot;)&#39;
   &quot;foo bar foo&quot;
=&gt; {&quot;offset&quot;: 0, &quot;length&quot;: 3, &quot;string&quot;: &quot;foo&quot;, &quot;captures&quot;: []}

jq &#39;match([&quot;foo&quot;, &quot;ig&quot;])&#39;
   &quot;foo bar FOO&quot;
=&gt; {&quot;offset&quot;: 0, &quot;length&quot;: 3, &quot;string&quot;: &quot;foo&quot;, &quot;captures&quot;: []}, {&quot;offset&quot;: 8, &quot;length&quot;: 3, &quot;string&quot;: &quot;FOO&quot;, &quot;captures&quot;: []}

jq &#39;match(&quot;foo (?&lt;bar123&gt;bar)? foo&quot;; &quot;ig&quot;)&#39;
   &quot;foo bar foo foo  foo&quot;
=&gt; {&quot;offset&quot;: 0, &quot;length&quot;: 11, &quot;string&quot;: &quot;foo bar foo&quot;, &quot;captures&quot;: [{&quot;offset&quot;: 4, &quot;length&quot;: 3, &quot;string&quot;: &quot;bar&quot;, &quot;name&quot;: &quot;bar123&quot;}]}, {&quot;offset&quot;: 12, &quot;length&quot;: 8, &quot;string&quot;: &quot;foo  foo&quot;, &quot;captures&quot;: [{&quot;offset&quot;: -1, &quot;length&quot;: 0, &quot;string&quot;: null, &quot;name&quot;: &quot;bar123&quot;}]}

jq &#39;[ match(&quot;.&quot;; &quot;g&quot;)] | length&#39;
   &quot;abc&quot;
=&gt; 3</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>capture(val), capture(regex; flags)</h2>
<p>Collects the named captures in a JSON object, with the name of each
capture as the key, and the matched string as the corresponding
value.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;capture(&quot;(?&lt;a&gt;[a-z]+)-(?&lt;n&gt;[0-9]+)&quot;)&#39;
   &quot;xyzzy-14&quot;
=&gt; { &quot;a&quot;: &quot;xyzzy&quot;, &quot;n&quot;: &quot;14&quot; }</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>scan(regex), scan(regex; flags)</h2>
<p>Emit a stream of the non-overlapping substrings of the input that
match the regex in accordance with the flags, if any have been
specified. If there is no match, the stream is empty. To capture all the
matches for each input string, use the idiom <b>[ expr ]</b>,
e.g. <b>[ scan(regex) ]</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;scan(&quot;c&quot;)&#39;
   &quot;abcdefabc&quot;
=&gt; &quot;c&quot;, &quot;c&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>split(regex; flags)</h2>
<p>Splits an input string on each regex match.</p>
<p>For backwards compatibility, when called with a single argument,
<b>split</b> splits on a string, not a regex.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;split(&quot;, *&quot;; null)&#39;
   &quot;ab,cd, ef&quot;
=&gt; [&quot;ab&quot;,&quot;cd&quot;,&quot;ef&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>splits(regex), splits(regex; flags)</h2>
<p>These provide the same results as their <b>split</b>
counterparts, but as a stream instead of an array.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;splits(&quot;, *&quot;)&#39;
   &quot;ab,cd,   ef, gh&quot;
=&gt; &quot;ab&quot;, &quot;cd&quot;, &quot;ef&quot;, &quot;gh&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>sub(regex; tostring), sub(regex; tostring; flags)</h2>
<p>Emit the string obtained by replacing the first match of regex in the
input string with <b>tostring</b>, after interpolation.
<b>tostring</b> should be a jq string or a stream of such
strings, each of which may contain references to named captures. The
named captures are, in effect, presented as a JSON object (as
constructed by <b>capture</b>) to <b>tostring</b>,
so a reference to a captured variable named "x" would take the form:
<b>"\(.x)"</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;sub(&quot;[^a-z]*(?&lt;x&gt;[a-z]+)&quot;; &quot;Z\(.x)&quot;; &quot;g&quot;)&#39;
   &quot;123abc456def&quot;
=&gt; &quot;ZabcZdef&quot;

jq &#39;[sub(&quot;(?&lt;a&gt;.)&quot;; &quot;\(.a|ascii_upcase)&quot;, &quot;\(.a|ascii_downcase)&quot;)]&#39;
   &quot;aB&quot;
=&gt; [&quot;AB&quot;,&quot;aB&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>gsub(regex; tostring), gsub(regex; tostring; flags)</h2>
<p><b>gsub</b> is like <b>sub</b> but all the
non-overlapping occurrences of the regex are replaced by
<b>tostring</b>, after interpolation. If the second argument
is a stream of jq strings, then <b>gsub</b> will produce a
corresponding stream of JSON strings.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;gsub(&quot;(?&lt;x&gt;.)[^a]*&quot;; &quot;+\(.x)-&quot;)&#39;
   &quot;Abcabc&quot;
=&gt; &quot;+A-+a-&quot;

jq &#39;[gsub(&quot;p&quot;; &quot;a&quot;, &quot;b&quot;)]&#39;
   &quot;p&quot;
=&gt; [&quot;a&quot;,&quot;b&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: ADVANCED FEATURES
content:
<p>Variables are an absolute necessity in most programming languages,
but they're relegated to an "advanced feature" in jq.</p>
<p>In most languages, variables are the only means of passing around
data. If you calculate a value, and you want to use it more than once,
you'll need to store it in a variable. To pass a value to another part
of the program, you'll need that part of the program to define a
variable (as a function parameter, object member, or whatever) in which
to place the data.</p>
<p>It is also possible to define functions in jq, although this is is a
feature whose biggest use is defining jq's standard library (many jq
functions such as <b>map</b> and <b>select</b> are
in fact written in jq).</p>
<p>jq has reduction operators, which are very powerful but a bit tricky.
Again, these are mostly used internally, to define some useful bits of
jq's standard library.</p>
<p>It may not be obvious at first, but jq is all about generators (yes,
as often found in other languages). Some utilities are provided to help
deal with generators.</p>
<p>Some minimal I/O support (besides reading JSON from standard input,
and writing JSON to standard output) is available.</p>
<p>Finally, there is a module/library system.</p>
<h2>Variable / Symbolic Binding Operator: ... as $identifier | ...</h2>
<p>In jq, all filters have an input and an output, so manual plumbing is
not necessary to pass a value from one part of a program to the next.
Many expressions, for instance <b>a + b</b>, pass their input
to two distinct subexpressions (here <b>a</b> and
<b>b</b> are both passed the same input), so variables aren't
usually necessary in order to use a value twice.</p>
<p>For instance, calculating the average value of an array of numbers
requires a few variables in most languages - at least one to hold the
array, perhaps one for each element or for a loop counter. In jq, it's
simply <b>add / length</b> - the <b>add</b>
expression is given the array and produces its sum, and the
<b>length</b> expression is given the array and produces its
length.</p>
<p>So, there's generally a cleaner way to solve most problems in jq than
defining variables. Still, sometimes they do make things easier, so jq
lets you define variables using <b>expression as
$variable</b>. All variable names start with <b>$</b>.
Here's a slightly uglier version of the array-averaging example:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
length as $array_length | add / $array_length</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>We'll need a more complicated problem to find a situation where using
variables actually makes our lives easier.</p>
<p>Suppose we have an array of blog posts, with "author" and "title"
fields, and another object which is used to map author usernames to real
names. Our input looks like:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;posts&quot;: [{&quot;title&quot;: &quot;First post&quot;, &quot;author&quot;: &quot;anon&quot;},
           {&quot;title&quot;: &quot;A well-written article&quot;, &quot;author&quot;: &quot;person1&quot;}],
 &quot;realnames&quot;: {&quot;anon&quot;: &quot;Anonymous Coward&quot;,
               &quot;person1&quot;: &quot;Person McPherson&quot;}}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>We want to produce the posts with the author field containing a real
name, as in:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;title&quot;: &quot;First post&quot;, &quot;author&quot;: &quot;Anonymous Coward&quot;}
{&quot;title&quot;: &quot;A well-written article&quot;, &quot;author&quot;: &quot;Person McPherson&quot;}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>We use a variable, $names, to store the realnames object, so that we
can refer to it later when looking up author usernames:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.realnames as $names | .posts[] | {title, author: $names[.author]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The expression <b>exp as $x | ...</b> means: for each value
of expression <b>exp</b>, run the rest of the pipeline with
the entire original input, and with <b>$x</b> set to that
value. Thus <b>as</b> functions as something of a foreach
loop.</p>
<p>Just as <b>{foo}</b> is a handy way of writing
<b>{foo: .foo}</b>, so <b>{$foo}</b> is a handy way
of writing <b>{foo: $foo}</b>.</p>
<p>Multiple variables may be declared using a single <b>as</b>
expression by providing a pattern that matches the structure of the
input (this is known as "destructuring"):</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
. as {realnames: $names, posts: [$first, $second]} | ...</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The variable declarations in array patterns (e.g., <b>. as
[$first, $second]</b>) bind to the elements of the array in from
the element at index zero on up, in order. When there is no value at the
index for an array pattern element, <b>null</b> is bound to
that variable.</p>
<p>Variables are scoped over the rest of the expression that defines
them, so</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.realnames as $names | (.posts[] | {title, author: $names[.author]})</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>will work, but</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
(.realnames as $names | .posts[]) | {title, author: $names[.author]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>won't.</p>
<p>For programming language theorists, it's more accurate to say that jq
variables are lexically-scoped bindings. In particular there's no way to
change the value of a binding; one can only setup a new binding with the
same name, but which will not be visible where the old one was.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.bar as $x | .foo | . + $x&#39;
   {&quot;foo&quot;:10, &quot;bar&quot;:200}
=&gt; 210

jq &#39;. as $i|[(.*2|. as $i| $i), $i]&#39;
   5
=&gt; [10,5]

jq &#39;. as [$a, $b, {c: $c}] | $a + $b + $c&#39;
   [2, 3, {&quot;c&quot;: 4, &quot;d&quot;: 5}]
=&gt; 9

jq &#39;.[] as [$a, $b] | {a: $a, b: $b}&#39;
   [[0], [0, 1], [2, 1, 0]]
=&gt; {&quot;a&quot;:0,&quot;b&quot;:null}, {&quot;a&quot;:0,&quot;b&quot;:1}, {&quot;a&quot;:2,&quot;b&quot;:1}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Destructuring Alternative Operator: ?//</h2>
<p>The destructuring alternative operator provides a concise mechanism
for destructuring an input that can take one of several forms.</p>
<p>Suppose we have an API that returns a list of resources and events
associated with them, and we want to get the user_id and timestamp of
the first event for each resource. The API (having been clumsily
converted from XML) will only wrap the events in an array if the
resource has multiple events:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
{&quot;resources&quot;: [{&quot;id&quot;: 1, &quot;kind&quot;: &quot;widget&quot;, &quot;events&quot;: {&quot;action&quot;: &quot;create&quot;, &quot;user_id&quot;: 1, &quot;ts&quot;: 13}},
               {&quot;id&quot;: 2, &quot;kind&quot;: &quot;widget&quot;, &quot;events&quot;: [{&quot;action&quot;: &quot;create&quot;, &quot;user_id&quot;: 1, &quot;ts&quot;: 14}, {&quot;action&quot;: &quot;destroy&quot;, &quot;user_id&quot;: 1, &quot;ts&quot;: 15}]}]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>We can use the destructuring alternative operator to handle this
structural change simply:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.resources[] as {$id, $kind, events: {$user_id, $ts}} ?// {$id, $kind, events: [{$user_id, $ts}]} | {$user_id, $kind, $id, $ts}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Or, if we aren't sure if the input is an array of values or an
object:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.[] as [$id, $kind, $user_id, $ts] ?// {$id, $kind, $user_id, $ts} | ...</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Each alternative need not define all of the same variables, but all
named variables will be available to the subsequent expression.
Variables not matched in the alternative that succeeded will be
<b>null</b>:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.resources[] as {$id, $kind, events: {$user_id, $ts}} ?// {$id, $kind, events: [{$first_user_id, $first_ts}]} | {$user_id, $first_user_id, $kind, $id, $ts, $first_ts}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Additionally, if the subsequent expression returns an error, the
alternative operator will attempt to try the next binding. Errors that
occur during the final alternative are passed through.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
[[3]] | .[] as [$a] ?// [$b] | if $a != null then error(&quot;err: \($a)&quot;) else {$a,$b} end

jq &#39;.[] as {$a, $b, c: {$d, $e}} ?// {$a, $b, c: [{$d, $e}]} | {$a, $b, $d, $e}&#39;
   [{&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: {&quot;d&quot;: 3, &quot;e&quot;: 4}}, {&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: [{&quot;d&quot;: 3, &quot;e&quot;: 4}]}]
=&gt; {&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:3,&quot;e&quot;:4}, {&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:3,&quot;e&quot;:4}

jq &#39;.[] as {$a, $b, c: {$d}} ?// {$a, $b, c: [{$e}]} | {$a, $b, $d, $e}&#39;
   [{&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: {&quot;d&quot;: 3, &quot;e&quot;: 4}}, {&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: [{&quot;d&quot;: 3, &quot;e&quot;: 4}]}]
=&gt; {&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:3,&quot;e&quot;:null}, {&quot;a&quot;:1,&quot;b&quot;:2,&quot;d&quot;:null,&quot;e&quot;:4}

jq &#39;.[] as [$a] ?// [$b] | if $a != null then error(&quot;err: \($a)&quot;) else {$a,$b} end&#39;
   [[3]]
=&gt; {&quot;a&quot;:null,&quot;b&quot;:3}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Defining Functions</h2>
<p>You can give a filter a name using "def" syntax:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
def increment: . + 1;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>From then on, <b>increment</b> is usable as a filter just
like a builtin function (in fact, this is how many of the builtins are
defined). A function may take arguments:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
def map(f): [.[] | f];</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Arguments are passed as <em>filters</em> (functions with no
arguments), <em>not</em> as values. The same argument may be referenced
multiple times with different inputs (here <b>f</b> is run for
each element of the input array). Arguments to a function work more like
callbacks than like value arguments. This is important to understand.
Consider:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
def foo(f): f|f;
5|foo(.*2)</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The result will be 20 because <b>f</b> is
<b>.*2</b>, and during the first invocation of
<b>f</b> <b>.</b> will be 5, and the second time it
will be 10 (5 * 2), so the result will be 20. Function arguments are
filters, and filters expect an input when invoked.</p>
<p>If you want the value-argument behaviour for defining simple
functions, you can just use a variable:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
def addvalue(f): f as $f | map(. + $f);</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Or use the short-hand:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
def addvalue($f): ...;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>With either definition, <b>addvalue(.foo)</b> will add the
current input's <b>.foo</b> field to each element of the
array. Do note that calling <b>addvalue(.[])</b> will cause
the <b>map(. + $f)</b> part to be evaluated once per value in
the value of <b>.</b> at the call site.</p>
<p>Multiple definitions using the same function name are allowed. Each
re-definition replaces the previous one for the same number of function
arguments, but only for references from functions (or main program)
subsequent to the re-definition. See also the section below on
scoping.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;def addvalue(f): . + [f]; map(addvalue(.[0]))&#39;
   [[1,2],[10,20]]
=&gt; [[1,2,1], [10,20,10]]

jq &#39;def addvalue(f): f as $x | map(. + $x); addvalue(.[0])&#39;
   [[1,2],[10,20]]
=&gt; [[1,2,1,2], [10,20,1,2]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Scoping</h2>
<p>There are two types of symbols in jq: value bindings (a.k.a.,
"variables"), and functions. Both are scoped lexically, with expressions
being able to refer only to symbols that have been defined "to the left"
of them. The only exception to this rule is that functions can refer to
themselves so as to be able to create recursive functions.</p>
<p>For example, in the following expression there is a binding which is
visible "to the right" of it, <b>... | .*3 as $times_three | [. +
$times_three] | ...</b>, but not "to the left". Consider this
expression now, <b>... | (.*3 as $times_three | [. + $times_three])
| ...</b>: here the binding <b>$times_three</b> is
<em>not</em> visible past the closing parenthesis.</p>
<h2>isempty(exp)</h2>
<p>Returns true if <b>exp</b> produces no outputs, false
otherwise.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;isempty(empty)&#39;
   null
=&gt; true

jq &#39;isempty(.[])&#39;
   []
=&gt; true

jq &#39;isempty(.[])&#39;
   [1,2,3]
=&gt; false</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>limit(n; exp)</h2>
<p>The <b>limit</b> function extracts up to <b>n</b>
outputs from <b>exp</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[limit(3;.[])]&#39;
   [0,1,2,3,4,5,6,7,8,9]
=&gt; [0,1,2]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>first(expr), last(expr), nth(n; expr)</h2>
<p>The <b>first(expr)</b> and <b>last(expr)</b>
functions extract the first and last values from <b>expr</b>,
respectively.</p>
<p>The <b>nth(n; expr)</b> function extracts the nth value
output by <b>expr</b>. Note that <b>nth(n; expr)</b>
doesn't support negative values of <b>n</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[first(range(.)), last(range(.)), nth(./2; range(.))]&#39;
   10
=&gt; [0,9,5]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>first, last, nth(n)</h2>
<p>The <b>first</b> and <b>last</b> functions
extract the first and last values from any array at
<b>.</b>.</p>
<p>The <b>nth(n)</b> function extracts the nth value of any
array at <b>.</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;[range(.)]|[first, last, nth(5)]&#39;
   10
=&gt; [0,9,5]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>reduce</h2>
<p>The <b>reduce</b> syntax allows you to combine all of the
results of an expression by accumulating them into a single answer. The
form is <b>reduce EXP as $var (INIT; UPDATE)</b>. As an
example, we'll pass <b>[1,2,3]</b> to this expression:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
reduce .[] as $item (0; . + $item)</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>For each result that <b>.[]</b> produces, <b>. +
$item</b> is run to accumulate a running total, starting from 0 as
the input value. In this example, <b>.[]</b> produces the
results <b>1</b>, <b>2</b>, and <b>3</b>,
so the effect is similar to running something like this:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
0 | 1 as $item | . + $item |
    2 as $item | . + $item |
    3 as $item | . + $item

jq &#39;reduce .[] as $item (0; . + $item)&#39;
   [1,2,3,4,5]
=&gt; 15

jq &#39;reduce .[] as [$i,$j] (0; . + $i * $j)&#39;
   [[1,2],[3,4],[5,6]]
=&gt; 44

jq &#39;reduce .[] as {$x,$y} (null; .x += $x | .y += [$y])&#39;
   [{&quot;x&quot;:&quot;a&quot;,&quot;y&quot;:1},{&quot;x&quot;:&quot;b&quot;,&quot;y&quot;:2},{&quot;x&quot;:&quot;c&quot;,&quot;y&quot;:3}]
=&gt; {&quot;x&quot;:&quot;abc&quot;,&quot;y&quot;:[1,2,3]}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>foreach</h2>
<p>The <b>foreach</b> syntax is similar to
<b>reduce</b>, but intended to allow the construction of
<b>limit</b> and reducers that produce intermediate
results.</p>
<p>The form is <b>foreach EXP as $var (INIT; UPDATE;
EXTRACT)</b>. As an example, we'll pass <b>[1,2,3]</b> to
this expression:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
foreach .[] as $item (0; . + $item; [$item, . * 2])</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>Like the <b>reduce</b> syntax, <b>. + $item</b>
is run for each result that <b>.[]</b> produces, but
<b>[$item, . * 2]</b> is run for each intermediate values. In
this example, since the intermediate values are <b>1</b>,
<b>3</b>, and <b>6</b>, the <b>foreach</b>
expression produces <b>[1,2]</b>, <b>[2,6]</b>, and
<b>[3,12]</b>. So the effect is similar to running something
like this:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
0 | 1 as $item | . + $item | [$item, . * 2],
    2 as $item | . + $item | [$item, . * 2],
    3 as $item | . + $item | [$item, . * 2]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>When <b>EXTRACT</b> is omitted, the identity filter is
used. That is, it outputs the intermediate values as they are.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;foreach .[] as $item (0; . + $item)&#39;
   [1,2,3,4,5]
=&gt; 1, 3, 6, 10, 15

jq &#39;foreach .[] as $item (0; . + $item; [$item, . * 2])&#39;
   [1,2,3,4,5]
=&gt; [1,2], [2,6], [3,12], [4,20], [5,30]

jq &#39;foreach .[] as $item (0; . + 1; {index: ., $item})&#39;
   [&quot;foo&quot;, &quot;bar&quot;, &quot;baz&quot;]
=&gt; {&quot;index&quot;:1,&quot;item&quot;:&quot;foo&quot;}, {&quot;index&quot;:2,&quot;item&quot;:&quot;bar&quot;}, {&quot;index&quot;:3,&quot;item&quot;:&quot;baz&quot;}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Recursion</h2>
<p>As described above, <b>recurse</b> uses recursion, and any
jq function can be recursive. The <b>while</b> builtin is also
implemented in terms of recursion.</p>
<p>Tail calls are optimized whenever the expression to the left of the
recursive call outputs its last value. In practice this means that the
expression to the left of the recursive call should not produce more
than one output for each input.</p>
<p>For example:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
def recurse(f): def r: ., (f | select(. != null) | r); r;

def while(cond; update):
  def _while:
    if cond then ., (update | _while) else empty end;
  _while;

def repeat(exp):
  def _repeat:
    exp, _repeat;
  _repeat;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Generators and iterators</h2>
<p>Some jq operators and functions are actually generators in that they
can produce zero, one, or more values for each input, just as one might
expect in other programming languages that have generators. For example,
<b>.[]</b> generates all the values in its input (which must
be an array or an object), <b>range(0; 10)</b> generates the
integers between 0 and 10, and so on.</p>
<p>Even the comma operator is a generator, generating first the values
generated by the expression to the left of the comma, then the values
generated by the expression on the right of the comma.</p>
<p>The <b>empty</b> builtin is the generator that produces
zero outputs. The <b>empty</b> builtin backtracks to the
preceding generator expression.</p>
<p>All jq functions can be generators just by using builtin generators.
It is also possible to construct new generators using only recursion and
the comma operator. If recursive calls are "in tail position" then the
generator will be efficient. In the example below the recursive call by
<b>_range</b> to itself is in tail position. The example shows
off three advanced topics: tail recursion, generator construction, and
sub-functions.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;def range(init; upto; by): def _range: if (by &gt; 0 and . &lt; upto) or (by &lt; 0 and . &gt; upto) then ., ((.+by)|_range) else . end; if by == 0 then init else init|_range end | select((by &gt; 0 and . &lt; upto) or (by &lt; 0 and . &gt; upto)); range(0; 10; 3)&#39;
   null
=&gt; 0, 3, 6, 9

jq &#39;def while(cond; update): def _while: if cond then ., (update | _while) else empty end; _while; [while(.&lt;100; .*2)]&#39;
   1
=&gt; [1,2,4,8,16,32,64]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: MATH
content:
<p>jq currently only has IEEE754 double-precision (64-bit) floating
point number support.</p>
<p>Besides simple arithmetic operators such as <b>+</b>, jq
also has most standard math functions from the C math library. C math
functions that take a single input argument (e.g.,
<b>sin()</b>) are available as zero-argument jq functions. C
math functions that take two input arguments (e.g.,
<b>pow()</b>) are available as two-argument jq functions that
ignore <b>.</b>. C math functions that take three input
arguments are available as three-argument jq functions that ignore
<b>.</b>.</p>
<p>Availability of standard math functions depends on the availability
of the corresponding math functions in your operating system and C math
library. Unavailable math functions will be defined but will raise an
error.</p>
<p>One-input C math functions: <b>acos</b>
<b>acosh</b> <b>asin</b> <b>asinh</b>
<b>atan</b> <b>atanh</b> <b>cbrt</b>
<b>ceil</b> <b>cos</b> <b>cosh</b>
<b>erf</b> <b>erfc</b> <b>exp</b>
<b>exp10</b> <b>exp2</b> <b>expm1</b>
<b>fabs</b> <b>floor</b> <b>gamma</b>
<b>j0</b> <b>j1</b> <b>lgamma</b>
<b>log</b> <b>log10</b> <b>log1p</b>
<b>log2</b> <b>logb</b> <b>nearbyint</b>
<b>pow10</b> <b>rint</b> <b>round</b>
<b>significand</b> <b>sin</b> <b>sinh</b>
<b>sqrt</b> <b>tan</b> <b>tanh</b>
<b>tgamma</b> <b>trunc</b> <b>y0</b>
<b>y1</b>.</p>
<p>Two-input C math functions: <b>atan2</b>
<b>copysign</b> <b>drem</b> <b>fdim</b>
<b>fmax</b> <b>fmin</b> <b>fmod</b>
<b>frexp</b> <b>hypot</b> <b>jn</b>
<b>ldexp</b> <b>modf</b> <b>nextafter</b>
<b>nexttoward</b> <b>pow</b>
<b>remainder</b> <b>scalb</b>
<b>scalbln</b> <b>yn</b>.</p>
<p>Three-input C math functions: <b>fma</b>.</p>
<p>See your system's manual for more information on each of these.</p>


title: I/O
content:
<p>At this time jq has minimal support for I/O, mostly in the form of
control over when inputs are read. Two builtins functions are provided
for this, <b>input</b> and <b>inputs</b>, that read
from the same sources (e.g., <b>stdin</b>, files named on the
command-line) as jq itself. These two builtins, and jq's own reading
actions, can be interleaved with each other. They are commonly used in
combination with the null input option <b>-n</b> to prevent
one input from being read implicitly.</p>
<p>Two builtins provide minimal output capabilities,
<b>debug</b>, and <b>stderr</b>. (Recall that a jq
program's output values are always output as JSON texts on
<b>stdout</b>.) The <b>debug</b> builtin can have
application-specific behavior, such as for executables that use the
libjq C API but aren't the jq executable itself. The
<b>stderr</b> builtin outputs its input in raw mode to stder
with no additional decoration, not even a newline.</p>
<p>Most jq builtins are referentially transparent, and yield constant
and repeatable value streams when applied to constant inputs. This is
not true of I/O builtins.</p>
<h2>input</h2>
<p>Outputs one new input.</p>
<p>Note that when using <b>input</b> it is generally be
necessary to invoke jq with the <b>-n</b> command-line option,
otherwise the first entity will be lost.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
echo 1 2 3 4 | jq &#39;[., input]&#39; # [1,2] [3,4]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>inputs</h2>
<p>Outputs all remaining inputs, one by one.</p>
<p>This is primarily useful for reductions over a program's inputs. Note
that when using <b>inputs</b> it is generally necessary to
invoke jq with the <b>-n</b> command-line option, otherwise
the first entity will be lost.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
echo 1 2 3 | jq -n &#39;reduce inputs as $i (0; . + $i)&#39; # 6</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>debug, debug(msgs)</h2>
<p>These two filters are like <b>.</b> but have as a
side-effect the production of one or more messages on stderr.</p>
<p>The message produced by the <b>debug</b> filter has the
form</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
[&quot;DEBUG:&quot;,&lt;input-value&gt;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>where <b>&lt;input-value&gt;</b> is a compact rendition of
the input value. This format may change in the future.</p>
<p>The <b>debug(msgs)</b> filter is defined as <b>(msgs |
debug | empty), .</b> thus allowing great flexibility in the
content of the message, while also allowing multi-line debugging
statements to be created.</p>
<p>For example, the expression:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
1 as $x | 2 | debug(&quot;Entering function foo with $x == \($x)&quot;, .) | (.+1)</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>would produce the value 3 but with the following two lines being
written to stderr:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
[&quot;DEBUG:&quot;,&quot;Entering function foo with $x == 1&quot;]
[&quot;DEBUG:&quot;,2]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>stderr</h2>
<p>Prints its input in raw and compact mode to stderr with no additional
decoration, not even a newline.</p>
<h2>input_filename</h2>
<p>Returns the name of the file whose input is currently being filtered.
Note that this will not work well unless jq is running in a UTF-8
locale.</p>
<h2>input_line_number</h2>
<p>Returns the line number of the input currently being filtered.</p>


title: STREAMING
content:
<p>With the <b>--stream</b> option jq can parse input texts in
a streaming fashion, allowing jq programs to start processing large JSON
texts immediately rather than after the parse completes. If you have a
single JSON text that is 1GB in size, streaming it will allow you to
process it much more quickly.</p>
<p>However, streaming isn't easy to deal with as the jq program will
have <b>[&lt;path&gt;, &lt;leaf-value&gt;]</b> (and a few
other forms) as inputs.</p>
<p>Several builtins are provided to make handling streams easier.</p>
<p>The examples below use the streamed form of <b>[0,[1]]</b>,
which is <b>[[0],0],[[1,0],1],[[1,0]],[[1]]</b>.</p>
<p>Streaming forms include <b>[&lt;path&gt;,
&lt;leaf-value&gt;]</b> (to indicate any scalar value, empty array,
or empty object), and <b>[&lt;path&gt;]</b> (to indicate the
end of an array or object). Future versions of jq run with
<b>--stream</b> and <b>--seq</b> may output
additional forms such as <b>["error message"]</b> when an
input text fails to parse.</p>
<h2>truncate_stream(stream_expression)</h2>
<p>Consumes a number as input and truncates the corresponding number of
path elements from the left of the outputs of the given streaming
expression.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]])&#39;
   1
=&gt; [[0],2], [[0]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>fromstream(stream_expression)</h2>
<p>Outputs values corresponding to the stream expression's outputs.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;fromstream(1|truncate_stream([[0],1],[[1,0],2],[[1,0]],[[1]]))&#39;
   null
=&gt; [2]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>tostream</h2>
<p>The <b>tostream</b> builtin outputs the streamed form of
its input.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;. as $dot|fromstream($dot|tostream)|.==$dot&#39;
   [0,[1,{&quot;a&quot;:1},{&quot;b&quot;:2}]]
=&gt; true</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: ASSIGNMENT
content:
<p>Assignment works a little differently in jq than in most programming
languages. jq doesn't distinguish between references to and copies of
something - two objects or arrays are either equal or not equal, without
any further notion of being "the same object" or "not the same
object".</p>
<p>If an object has two fields which are arrays, <b>.foo</b>
and <b>.bar</b>, and you append something to
<b>.foo</b>, then <b>.bar</b> will not get bigger,
even if you've previously set <b>.bar = .foo</b>. If you're
used to programming in languages like Python, Java, Ruby, JavaScript,
etc. then you can think of it as though jq does a full deep copy of
every object before it does the assignment (for performance it doesn't
actually do that, but that's the general idea).</p>
<p>This means that it's impossible to build circular values in jq (such
as an array whose first element is itself). This is quite intentional,
and ensures that anything a jq program can produce can be represented in
JSON.</p>
<p>All the assignment operators in jq have path expressions on the
left-hand side (LHS). The right-hand side (RHS) provides values to set
to the paths named by the LHS path expressions.</p>
<p>Values in jq are always immutable. Internally, assignment works by
using a reduction to compute new, replacement values for
<b>.</b> that have had all the desired assignments applied to
<b>.</b>, then outputting the modified value. This might be
made clear by this example: <b>{a:{b:{c:1}}} | (.a.b|=3),
.</b>. This will output <b>{"a":{"b":3}}</b> and
<b>{"a":{"b":{"c":1}}}</b> because the last sub-expression,
<b>.</b>, sees the original value, not the modified value.</p>
<p>Most users will want to use modification assignment operators, such
as <b>|=</b> or <b>+=</b>, rather than
<b>=</b>.</p>
<p>Note that the LHS of assignment operators refers to a value in
<b>.</b>. Thus <b>$var.foo = 1</b> won't work as
expected (<b>$var.foo</b> is not a valid or useful path
expression in <b>.</b>); use <b>$var | .foo = 1</b>
instead.</p>
<p>Note too that <b>.a,.b=0</b> does not set
<b>.a</b> and <b>.b</b>, but
<b>(.a,.b)=0</b> sets both.</p>
<h2>Update-assignment: |=</h2>
<p>This is the "update" operator <b>|=</b>. It takes a filter
on the right-hand side and works out the new value for the property of
<b>.</b> being assigned to by running the old value through
this expression. For instance, <b>(.foo, .bar) |= .+1</b> will
build an object with the <b>foo</b> field set to the input's
<b>foo</b> plus 1, and the <b>bar</b> field set to
the input's <b>bar</b> plus 1.</p>
<p>The left-hand side can be any general path expression; see
<b>path()</b>.</p>
<p>Note that the left-hand side of <b>|=</b> refers to a value
in <b>.</b>. Thus <b>$var.foo |= . + 1</b> won't
work as expected (<b>$var.foo</b> is not a valid or useful
path expression in <b>.</b>); use <b>$var | .foo |= . +
1</b> instead.</p>
<p>If the right-hand side outputs no values (i.e.,
<b>empty</b>), then the left-hand side path will be deleted,
as with <b>del(path)</b>.</p>
<p>If the right-hand side outputs multiple values, only the first one
will be used (COMPATIBILITY NOTE: in jq 1.5 and earlier releases, it
used to be that only the last one was used).</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;(..|select(type==&quot;boolean&quot;)) |= if . then 1 else 0 end&#39;
   [true,false,[5,true,[true,[false]],false]]
=&gt; [1,0,[5,1,[1,[0]],0]]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Arithmetic update-assignment: +=, -=, *=, /=, %=, //=</h2>
<p>jq has a few operators of the form <b>a op= b</b>, which
are all equivalent to <b>a |= . op b</b>. So, <b>+=
1</b> can be used to increment values, being the same as <b>|=
. + 1</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.foo += 1&#39;
   {&quot;foo&quot;: 42}
=&gt; {&quot;foo&quot;: 43}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Plain assignment: =</h2>
<p>This is the plain assignment operator. Unlike the others, the input
to the right-hand side (RHS) is the same as the input to the left-hand
side (LHS) rather than the value at the LHS path, and all values output
by the RHS will be used (as shown below).</p>
<p>If the RHS of <b>=</b> produces multiple values, then for
each such value jq will set the paths on the left-hand side to the value
and then it will output the modified <b>.</b>. For example,
<b>(.a,.b) = range(2)</b> outputs
<b>{"a":0,"b":0}</b>, then <b>{"a":1,"b":1}</b>. The
"update" assignment forms (see above) do not do this.</p>
<p>This example should show the difference between <b>=</b>
and <b>|=</b>:</p>
<p>Provide input <b>{"a": {"b": 10}, "b": 20}</b> to the
programs</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.a = .b</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>and</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.a |= .b</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The former will set the <b>a</b> field of the input to the
<b>b</b> field of the input, and produce the output
<b>{"a": 20, "b": 20}</b>. The latter will set the
<b>a</b> field of the input to the <b>a</b> field's
<b>b</b> field, producing <b>{"a": 10, "b":
20}</b>.</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
jq &#39;.a = .b&#39;
   {&quot;a&quot;: {&quot;b&quot;: 10}, &quot;b&quot;: 20}
=&gt; {&quot;a&quot;:20,&quot;b&quot;:20}

jq &#39;.a |= .b&#39;
   {&quot;a&quot;: {&quot;b&quot;: 10}, &quot;b&quot;: 20}
=&gt; {&quot;a&quot;:10,&quot;b&quot;:20}

jq &#39;(.a, .b) = range(3)&#39;
   null
=&gt; {&quot;a&quot;:0,&quot;b&quot;:0}, {&quot;a&quot;:1,&quot;b&quot;:1}, {&quot;a&quot;:2,&quot;b&quot;:2}

jq &#39;(.a, .b) |= range(3)&#39;
   null
=&gt; {&quot;a&quot;:0,&quot;b&quot;:0}</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<h2>Complex assignments</h2>
<p>Lots more things are allowed on the left-hand side of a jq assignment
than in most languages. We've already seen simple field accesses on the
left hand side, and it's no surprise that array accesses work just as
well:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.posts[0].title = &quot;JQ Manual&quot;</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>What may come as a surprise is that the expression on the left may
produce multiple results, referring to different points in the input
document:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.posts[].comments |= . + [&quot;this is great&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>That example appends the string "this is great" to the "comments"
array of each post in the input (where the input is an object with a
field "posts" which is an array of posts).</p>
<p>When jq encounters an assignment like 'a = b', it records the "path"
taken to select a part of the input document while executing a. This
path is then used to find which part of the input to change while
executing the assignment. Any filter may be used on the left-hand side
of an equals - whichever paths it selects from the input will be where
the assignment is performed.</p>
<p>This is a very powerful operation. Suppose we wanted to add a comment
to blog posts, using the same "blog" input above. This time, we only
want to comment on the posts written by "stedolan". We can find those
posts using the "select" function described earlier:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
.posts[] | select(.author == &quot;stedolan&quot;)</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The paths provided by this operation point to each of the posts that
"stedolan" wrote, and we can comment on each of them in the same way
that we did before:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
(.posts[] | select(.author == &quot;stedolan&quot;) | .comments) |=
    . + [&quot;terrible.&quot;]</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: MODULES
content:
<p>jq has a library/module system. Modules are files whose names end in
<b>.jq</b>.</p>
<p>Modules imported by a program are searched for in a default search
path (see below). The <b>import</b> and
<b>include</b> directives allow the importer to alter this
path.</p>
<p>Paths in the a search path are subject to various substitutions.</p>
<p>For paths starting with <b>~/</b>, the user's home
directory is substituted for <b>~</b>.</p>
<p>For paths starting with <b>$ORIGIN/</b>, the directory
where the jq executable is located is substituted for
<b>$ORIGIN</b>.</p>
<p>For paths starting with <b>./</b> or paths that are
<b>.</b>, the path of the including file is substituted for
<b>.</b>. For top-level programs given on the command-line,
the current directory is used.</p>
<p>Import directives can optionally specify a search path to which the
default is appended.</p>
<p>The default search path is the search path given to the
<b>-L</b> command-line option, else <b>["~/.jq",
"$ORIGIN/../lib/jq", "$ORIGIN/../lib"]</b>.</p>
<p>Null and empty string path elements terminate search path
processing.</p>
<p>A dependency with relative path <b>foo/bar</b> would be
searched for in <b>foo/bar.jq</b> and
<b>foo/bar/bar.jq</b> in the given search path. This is
intended to allow modules to be placed in a directory along with, for
example, version control files, README files, and so on, but also to
allow for single-file modules.</p>
<p>Consecutive components with the same name are not allowed to avoid
ambiguities (e.g., <b>foo/foo</b>).</p>
<p>For example, with <b>-L$HOME/.jq</b> a module
<b>foo</b> can be found in <b>$HOME/.jq/foo.jq</b>
and <b>$HOME/.jq/foo/foo.jq</b>.</p>
<p>If <b>$HOME/.jq</b> is a file, it is sourced into the main
program.</p>
<h2>import RelativePathString as NAME [&lt;metadata&gt;];</h2>
<p>Imports a module found at the given path relative to a directory in a
search path. A <b>.jq</b> suffix will be added to the relative
path string. The module's symbols are prefixed with
<b>NAME::</b>.</p>
<p>The optional metadata must be a constant jq expression. It should be
an object with keys like <b>homepage</b> and so on. At this
time jq only uses the <b>search</b> key/value of the metadata.
The metadata is also made available to users via the
<b>modulemeta</b> builtin.</p>
<p>The <b>search</b> key in the metadata, if present, should
have a string or array value (array of strings); this is the search path
to be prefixed to the top-level search path.</p>
<h2>include RelativePathString [&lt;metadata&gt;];</h2>
<p>Imports a module found at the given path relative to a directory in a
search path as if it were included in place. A <b>.jq</b>
suffix will be added to the relative path string. The module's symbols
are imported into the caller's namespace as if the module's content had
been included directly.</p>
<p>The optional metadata must be a constant jq expression. It should be
an object with keys like <b>homepage</b> and so on. At this
time jq only uses the <b>search</b> key/value of the metadata.
The metadata is also made available to users via the
<b>modulemeta</b> builtin.</p>
<h2>import RelativePathString as $NAME [&lt;metadata&gt;];</h2>
<p>Imports a JSON file found at the given path relative to a directory
in a search path. A <b>.json</b> suffix will be added to the
relative path string. The file's data will be available as
<b>$NAME::NAME</b>.</p>
<p>The optional metadata must be a constant jq expression. It should be
an object with keys like <b>homepage</b> and so on. At this
time jq only uses the <b>search</b> key/value of the metadata.
The metadata is also made available to users via the
<b>modulemeta</b> builtin.</p>
<p>The <b>search</b> key in the metadata, if present, should
have a string or array value (array of strings); this is the search path
to be prefixed to the top-level search path.</p>
<h2>module &lt;metadata&gt;;</h2>
<p>This directive is entirely optional. It's not required for proper
operation. It serves only the purpose of providing metadata that can be
read with the <b>modulemeta</b> builtin.</p>
<p>The metadata must be a constant jq expression. It should be an object
with keys like <b>homepage</b>. At this time jq doesn't use
this metadata, but it is made available to users via the
<b>modulemeta</b> builtin.</p>
<h2>modulemeta</h2>
<p>Takes a module name as input and outputs the module's metadata as an
object, with the module's imports (including metadata) as an array value
for the <b>deps</b> key and the module's defined functions as
an array value for the <b>defs</b> key.</p>
<p>Programs can use this to query a module's metadata, which they could
then use to, for example, search for, download, and install missing
dependencies.</p>


title: COLORS
content:
<p>To configure alternative colors just set the
<b>JQ_COLORS</b> environment variable to colon-delimited list
of partial terminal escape sequences like <b>"1;31"</b>, in
this order:</p>
<ul>
<li><p>color for <b>null</b></p></li>
<li><p>color for <b>false</b></p></li>
<li><p>color for <b>true</b></p></li>
<li><p>color for numbers</p></li>
<li><p>color for strings</p></li>
<li><p>color for arrays</p></li>
<li><p>color for objects</p></li>
<li><p>color for object keys</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>The default color scheme is the same as setting
<b>JQ_COLORS="0;90:0;37:0;37:0;37:0;32:1;37:1;37:1;34"</b>.</p>
<p>This is not a manual for VT100/ANSI escapes. However, each of these
color specifications should consist of two numbers separated by a
semi-colon, where the first number is one of these:</p>
<ul>
<li><p>1 (bright)</p></li>
<li><p>2 (dim)</p></li>
<li><p>4 (underscore)</p></li>
<li><p>5 (blink)</p></li>
<li><p>7 (reverse)</p></li>
<li><p>8 (hidden)</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<p>and the second is one of these:</p>
<ul>
<li><p>30 (black)</p></li>
<li><p>31 (red)</p></li>
<li><p>32 (green)</p></li>
<li><p>33 (yellow)</p></li>
<li><p>34 (blue)</p></li>
<li><p>35 (magenta)</p></li>
<li><p>36 (cyan)</p></li>
<li><p>37 (white)</p></li>
</ul>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: BUGS
content:
<p>Presumably. Report them or discuss them at:</p>
<dl>
<dt></dt>
<dd>

</dd>
</dl>
<pre><code>
https://github.com/jqlang/jq/issues</code></pre>
<dl>
<dt></dt>
<dd>

</dd>
</dl>


title: OPTIONS
content:
<blockquote>
<dl>
<dt><b>-h, --help</b></dt>
<dd>
<p>Show help.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--debug</b></dt>
<dd>
<p>Let unhandled exceptions propagate outside the main subroutine,
instead of logging them to stderr.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--isolated</b></dt>
<dd>
<p>Run pip in an isolated mode, ignoring environment variables and user
configuration.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--require-virtualenv</b></dt>
<dd>
<p>Allow pip to only run in a virtual environment; exit with an error
otherwise.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--python &lt;python&gt;</b></dt>
<dd>
<p>Run pip with the specified Python interpreter.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>-v, --verbose</b></dt>
<dd>
<p>Give more output. Option is additive, and can be used up to 3
times.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>-V, --version</b></dt>
<dd>
<p>Show version and exit.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>-q, --quiet</b></dt>
<dd>
<p>Give less output. Option is additive, and can be used up to 3 times
(corresponding to WARNING, ERROR, and CRITICAL logging levels).</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--log &lt;path&gt;</b></dt>
<dd>
<p>Path to a verbose appending log.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--no-input</b></dt>
<dd>
<p>Disable prompting for input.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--keyring-provider &lt;keyring_provider&gt;</b></dt>
<dd>
<p>Enable the credential lookup via the keyring library if user input is
allowed. Specify which mechanism to use [disabled, import, subprocess].
(default: disabled)</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--proxy &lt;proxy&gt;</b></dt>
<dd>
<p>Specify a proxy in the form
scheme://[user:passwd@]proxy.server:port.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--retries &lt;retries&gt;</b></dt>
<dd>
<p>Maximum number of retries each connection should attempt (default 5
times).</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--timeout &lt;sec&gt;</b></dt>
<dd>
<p>Set the socket timeout (default 15 seconds).</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--exists-action &lt;action&gt;</b></dt>
<dd>
<p>Default action when a path already exists: (s)witch, (i)gnore,
(w)ipe, (b)ackup, (a)bort.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--trusted-host &lt;hostname&gt;</b></dt>
<dd>
<p>Mark this host or host:port pair as trusted, even though it does not
have valid or any HTTPS.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--cert &lt;path&gt;</b></dt>
<dd>
<p>Path to PEM-encoded CA certificate bundle. If provided, overrides the
default. See 'SSL Certificate Verification' in pip documentation for
more information.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--client-cert &lt;path&gt;</b></dt>
<dd>
<p>Path to SSL client certificate, a single file containing the private
key and the certificate in PEM format.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--cache-dir &lt;dir&gt;</b></dt>
<dd>
<p>Store the cache data in &lt;dir&gt;.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--no-cache-dir</b></dt>
<dd>
<p>Disable the cache.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--disable-pip-version-check</b></dt>
<dd>
<p>Don't periodically check PyPI to determine whether a new version of
pip is available for download. Implied with --no-index.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--no-color</b></dt>
<dd>
<p>Suppress colored output.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--no-python-version-warning</b></dt>
<dd>
<p>Silence deprecation warnings for upcoming unsupported Pythons.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--use-feature &lt;feature&gt;</b></dt>
<dd>
<p>Enable new functionality, that may be backward incompatible.</p>
</dd>
</dl>
</blockquote>
<blockquote>
<dl>
<dt><b>--use-deprecated &lt;feature&gt;</b></dt>
<dd>
<p>Enable deprecated functionality, that will be removed in the
future.</p>
</dd>
</dl>
</blockquote>


title: COMMANDS
content:
<blockquote>
<dl>
<dt><b>pip-install(1)</b></dt>
<dd>
<p>Install packages.</p>
</dd>
<dt><b>pip-download(1)</b></dt>
<dd>
<p>Download packages.</p>
</dd>
<dt><b>pip-uninstall(1)</b></dt>
<dd>
<p>Uninstall packages.</p>
</dd>
<dt><b>pip-freeze(1)</b></dt>
<dd>
<p>Output installed packages in requirements format.</p>
</dd>
<dt><b>pip-list(1)</b></dt>
<dd>
<p>List installed packages.</p>
</dd>
<dt><b>pip-show(1)</b></dt>
<dd>
<p>Show information about installed packages.</p>
</dd>
<dt><b>pip-check(1)</b></dt>
<dd>
<p>Verify installed packages have compatible dependencies.</p>
</dd>
<dt><b>pip-search(1)</b></dt>
<dd>
<p>Search PyPI for packages.</p>
</dd>
<dt><b>pip-wheel(1)</b></dt>
<dd>
<p>Build wheels from your requirements.</p>
</dd>
<dt><b>pip-hash(1)</b></dt>
<dd>
<p>Compute hashes of package archives.</p>
</dd>
<dt><b>pip-help(1)</b></dt>
<dd>
<p>Show help for pip commands.</p>
</dd>
</dl>
</blockquote>


title: SYNOPSIS
content:
<p><b>openssl</b> <b>dgst</b>|<em>digest</em>
[<b>-</b><em><b>digest</b></em>]
[<b>-list</b>] [<b>-help</b>] [<b>-c</b>]
[<b>-d</b>] [<b>-debug</b>] [<b>-hex</b>]
[<b>-binary</b>] [<b>-xoflen</b> <em>length</em>]
[<b>-r</b>] [<b>-out</b> <em>filename</em>]
[<b>-sign</b> <em>filename</em>|<em>uri</em>]
[<b>-keyform</b>
<b>DER</b>|<b>PEM</b>|<b>P12</b>|<b>ENGINE</b>]
[<b>-passin</b> <em>arg</em>] [<b>-verify</b>
<em>filename</em>] [<b>-prverify</b> <em>filename</em>]
[<b>-signature</b> <em>filename</em>]
[<b>-sigopt</b> <em>nm</em>:<em>v</em>]
[<b>-hmac</b> <em>key</em>] [<b>-mac</b>
<em>alg</em>] [<b>-macopt</b> <em>nm</em>:<em>v</em>]
[<b>-fips-fingerprint</b>] [<b>-engine</b>
<em>id</em>] [<b>-engine_impl</b> <em>id</em>]
[<b>-rand</b> <em>files</em>] [<b>-writerand</b>
<em>file</em>] [<b>-provider</b> <em>name</em>]
[<b>-provider-path</b> <em>path</em>]
[<b>-propquery</b> <em>propq</em>] [<em>file</em> ...]</p>


title: DESCRIPTION
content:
<p>This command output the message digest of a supplied file or files in
hexadecimal, and also generates and verifies digital signatures using
message digests.</p>
<p>The generic name, <b>openssl dgst</b>, may be used with an
option specifying the algorithm to be used. The default digest is
<b>sha256</b>. A supported <em>digest</em> name may also be
used as the sub-command name. To see the list of supported algorithms,
use <code>openssl list -digest-algorithms</code></p>


title: OPTIONS
content:
<dl>
<dt>-help</dt>
<dd>
<p>Print out a usage message.</p>
</dd>
<dt>-digest</dt>
<dd>
<p>Specifies name of a supported digest to be used. See option
<b>-list</b> below :</p>
</dd>
<dt>-list</dt>
<dd>
<p>Prints out a list of supported message digests.</p>
</dd>
<dt>-c</dt>
<dd>
<p>Print out the digest in two digit groups separated by colons, only
relevant if the <b>-hex</b> option is given as well.</p>
</dd>
<dt>-d, -debug</dt>
<dd>
<p>Print out BIO debugging information.</p>
</dd>
<dt>-hex</dt>
<dd>
<p>Digest is to be output as a hex dump. This is the default case for a
"normal" digest as opposed to a digital signature. See NOTES below for
digital signatures using <b>-hex</b>.</p>
</dd>
<dt>-binary</dt>
<dd>
<p>Output the digest or signature in binary form.</p>
</dd>
<dt>-xoflen length</dt>
<dd>
<p>Set the output length for XOF algorithms, such as
<b>shake128</b> and <b>shake256</b>. This option is
not supported for signing operations. For OpenSSL providers it is
recommended to set this value for shake algorithms, since the default
values are set to only supply half of the maximum security strength. For
backwards compatibility reasons the default xoflen length for
<b>shake128</b> is 16 (bytes) which results in a security
strength of only 64 bits. To ensure the maximum security strength of 128
bits, the xoflen should be set to at least 32. For backwards
compatibility reasons the default xoflen length for
<b>shake256</b> is 32 (bytes) which results in a security
strength of only 128 bits. To ensure the maximum security strength of
256 bits, the xoflen should be set to at least 64.</p>
</dd>
<dt>-r</dt>
<dd>
<p>Output the digest in the "coreutils" format, including newlines. Used
by programs like <b>sha1sum</b> (1).</p>
</dd>
<dt>-out filename</dt>
<dd>
<p>Filename to output to, or standard output by default.</p>
</dd>
<dt>-sign filename|uri</dt>
<dd>
<p>Digitally sign the digest using the given private key. Note this
option does not support Ed25519 or Ed448 private keys. Use the
<b>openssl-pkeyutl</b> (1) command instead for this.</p>
</dd>
<dt>-keyform DER|PEM|P12|ENGINE</dt>
<dd>
<p>The format of the key to sign with; unspecified by default. See
<b>openssl-format-options</b> (1) for details.</p>
</dd>
<dt>-sigopt nm:v</dt>
<dd>
<p>Pass options to the signature algorithm during sign or verify
operations. Names and values of these options are
algorithm-specific.</p>
</dd>
<dt>-passin arg</dt>
<dd>
<p>The private key password source. For more information about the
format of <em>arg</em> see
<b>openssl-passphrase-options</b> (1).</p>
</dd>
<dt>-verify filename</dt>
<dd>
<p>Verify the signature using the public key in "filename". The output
is either "Verified OK" or "Verification Failure".</p>
</dd>
<dt>-prverify filename</dt>
<dd>
<p>Verify the signature using the private key in "filename".</p>
</dd>
<dt>-signature filename</dt>
<dd>
<p>The actual signature to verify.</p>
</dd>
<dt>-hmac key</dt>
<dd>
<p>Create a hashed MAC using "key". The <b>openssl-mac</b> (1)
command should be preferred to using this command line option.</p>
</dd>
<dt>-mac alg</dt>
<dd>
<p>Create MAC (keyed Message Authentication Code). The most popular MAC
algorithm is HMAC (hash-based MAC), but there are other MAC algorithms
which are not based on hash, for instance <b>gost-mac</b>
algorithm, supported by the <b>gost</b> engine. MAC keys and
other options should be set via <b>-macopt</b> parameter. The
<b>openssl-mac</b> (1) command should be preferred to using
this command line option.</p>
</dd>
<dt>-macopt nm:v</dt>
<dd>
<p>Passes options to MAC algorithm, specified by <b>-mac</b>
key. Following options are supported by both by <b>HMAC</b>
and <b>gost-mac</b>:</p>
<dl>
<dt>key:string</dt>
<dd>
<p>Specifies MAC key as alphanumeric string (use if key contain
printable characters only). String length must conform to any
restrictions of the MAC algorithm for example exactly 32 chars for
gost-mac.</p>
</dd>
<dt>hexkey:string</dt>
<dd>
<p>Specifies MAC key in hexadecimal form (two hex digits per byte). Key
length must conform to any restrictions of the MAC algorithm for example
exactly 32 chars for gost-mac.</p>
</dd>
</dl>
<p>The <b>openssl-mac</b> (1) command should be preferred to
using this command line option.</p>
</dd>
<dt>-fips-fingerprint</dt>
<dd>
<p>Compute HMAC using a specific key for certain OpenSSL-FIPS
operations.</p>
</dd>
<dt>-rand files, -writerand file</dt>
<dd>
<p>See "Random State Options" in <b>openssl</b> (1) for
details.</p>
</dd>
<dt>-engine id</dt>
<dd>
<p>See "Engine Options" in <b>openssl</b> (1). This option is
deprecated. The engine is not used for digests unless the
<b>-engine_impl</b> option is used or it is configured to do
so, see "Engine Configuration Module" in
<b>config</b> (5).</p>
</dd>
<dt>-engine_impl id</dt>
<dd>
<p>When used with the <b>-engine</b> option, it specifies to
also use engine <em>id</em> for digest operations.</p>
</dd>
<dt>-provider name</dt>
<dd>

</dd>
</dl>
<dl>
<dt>-provider-path path</dt>
<dd>

</dd>
<dt>-propquery propq</dt>
<dd>

</dd>
</dl>
<p>See "Provider Options" in <b>openssl</b> (1),
<b>provider</b> (7), and <b>property</b> (7).</p>
<dl>
<dt>file ...</dt>
<dd>
<p>File or files to digest. If no files are specified then standard
input is used.</p>
</dd>
</dl>


title: EXAMPLES
content:
<p>To create a hex-encoded message digest of a file:</p>
<p>openssl dgst -md5 -hex file.txt or openssl md5 file.txt</p>
<p>To sign a file using SHA-256 with binary file output:</p>
<p>openssl dgst -sha256 -sign privatekey.pem -out signature.sign
file.txt or openssl sha256 -sign privatekey.pem -out signature.sign
file.txt</p>
<p>To verify a signature:</p>
<p>openssl dgst -sha256 -verify publickey.pem \ -signature
signature.sign \ file.txt</p>


title: NOTES
content:
<p>The digest mechanisms that are available will depend on the options
used when building OpenSSL. The
<code>openssl list -digest-algorithms</code> command can be used to list
them.</p>
<p>New or agile applications should use probably use SHA-256. Other
digests, particularly SHA-1 and MD5, are still widely used for
interoperating with existing formats and protocols.</p>
<p>When signing a file, this command will automatically determine the
algorithm (RSA, ECC, etc) to use for signing based on the private key's
ASN.1 info. When verifying signatures, it only handles the RSA, DSA, or
ECDSA signature itself, not the related data to identify the signer and
algorithm used in formats such as x.509, CMS, and S/MIME.</p>
<p>A source of random numbers is required for certain signing
algorithms, in particular ECDSA and DSA.</p>
<p>The signing and verify options should only be used if a single file
is being signed or verified.</p>
<p>Hex signatures cannot be verified using <b>openssl</b>.
Instead, use "xxd -r" or similar program to transform the hex signature
into a binary signature prior to verification.</p>
<p>The <b>openssl-mac</b> (1) command is preferred over the
<b>-hmac</b>, <b>-mac</b> and
<b>-macopt</b> command line options.</p>


title: HISTORY
content:
<p>The default digest was changed from MD5 to SHA256 in OpenSSL 1.1.0.
The FIPS-related options were removed in OpenSSL 1.1.0.</p>
<p>The <b>-engine</b> and <b>-engine_impl</b>
options were deprecated in OpenSSL 3.0.</p>


title: COPYRIGHT
content:
<p>Copyright 2000-2022 The OpenSSL Project Authors. All Rights
Reserved.</p>
<p>Licensed under the Apache License 2.0 (the "License"). You may not
use this file except in compliance with the License. You can obtain a
copy in the file LICENSE in the source distribution or at
&lt;https://www.openssl.org/source/license.html&gt;.</p>


title: DESCRIPTION
content:
<p>Binwalk v2.1.1 Craig Heffner, http://www.binwalk.org</p>
<h2>Signature Scan Options:</h2>
<dl>
<dt><b>-B</b>, <b>--signature</b></dt>
<dd>
<p>Scan target file(s) for common file signatures</p>
</dd>
<dt><b>-R</b>, <b>--raw=</b>&lt;str&gt;</dt>
<dd>
<p>Scan target file(s) for the specified sequence of bytes</p>
</dd>
<dt><b>-A</b>, <b>--opcodes</b></dt>
<dd>
<p>Scan target file(s) for common executable opcode signatures</p>
</dd>
<dt><b>-m</b>, <b>--magic=</b>&lt;file&gt;</dt>
<dd>
<p>Specify a custom magic file to use</p>
</dd>
<dt><b>-b</b>, <b>--dumb</b></dt>
<dd>
<p>Disable smart signature keywords</p>
</dd>
<dt><b>-I</b>, <b>--invalid</b></dt>
<dd>
<p>Show results marked as invalid</p>
</dd>
<dt><b>-x</b>, <b>--exclude=</b>&lt;str&gt;</dt>
<dd>
<p>Exclude results that match &lt;str&gt;</p>
</dd>
<dt><b>-y</b>, <b>--include=</b>&lt;str&gt;</dt>
<dd>
<p>Only show results that match &lt;str&gt;</p>
</dd>
</dl>
<h2>Extraction Options:</h2>
<dl>
<dt><b>-e</b>, <b>--extract</b></dt>
<dd>
<p>Automatically extract known file types</p>
</dd>
<dt><b>-D</b>, <b>--dd=</b>&lt;type:ext:cmd&gt;</dt>
<dd>
<p>Extract &lt;type&gt; signatures, give the files an extension of
&lt;ext&gt;, and execute &lt;cmd&gt;</p>
</dd>
<dt><b>-M</b>, <b>--matryoshka</b></dt>
<dd>
<p>Recursively scan extracted files</p>
</dd>
<dt><b>-d</b>, <b>--depth=</b>&lt;int&gt;</dt>
<dd>
<p>Limit matryoshka recursion depth (default: 8 levels deep)</p>
</dd>
<dt><b>-C</b>, <b>--directory=</b>&lt;str&gt;</dt>
<dd>
<p>Extract files/folders to a custom directory (default: current working
directory)</p>
</dd>
<dt><b>-j</b>, <b>--size=</b>&lt;int&gt;</dt>
<dd>
<p>Limit the size of each extracted file</p>
</dd>
<dt><b>-n</b>, <b>--count=</b>&lt;int&gt;</dt>
<dd>
<p>Limit the number of extracted files</p>
</dd>
<dt><b>-r</b>, <b>--rm</b></dt>
<dd>
<p>Delete carved files after extraction</p>
</dd>
<dt><b>-z</b>, <b>--carve</b></dt>
<dd>
<p>Carve data from files, but don't execute extraction utilities</p>
</dd>
</dl>
<h2>Entropy Analysis Options:</h2>
<dl>
<dt><b>-E</b>, <b>--entropy</b></dt>
<dd>
<p>Calculate file entropy</p>
</dd>
<dt><b>-F</b>, <b>--fast</b></dt>
<dd>
<p>Use faster, but less detailed, entropy analysis</p>
</dd>
<dt><b>-J</b>, <b>--save</b></dt>
<dd>
<p>Save plot as a PNG</p>
</dd>
<dt><b>-Q</b>, <b>--nlegend</b></dt>
<dd>
<p>Omit the legend from the entropy plot graph</p>
</dd>
<dt><b>-N</b>, <b>--nplot</b></dt>
<dd>
<p>Do not generate an entropy plot graph</p>
</dd>
<dt><b>-H</b>, <b>--high=</b>&lt;float&gt;</dt>
<dd>
<p>Set the rising edge entropy trigger threshold (default: 0.95)</p>
</dd>
<dt><b>-L</b>, <b>--low=</b>&lt;float&gt;</dt>
<dd>
<p>Set the falling edge entropy trigger threshold (default: 0.85)</p>
</dd>
</dl>
<h2>Binary Diffing Options:</h2>
<dl>
<dt><b>-W</b>, <b>--hexdump</b></dt>
<dd>
<p>Perform a hexdump / diff of a file or files</p>
</dd>
<dt><b>-G</b>, <b>--green</b></dt>
<dd>
<p>Only show lines containing bytes that are the same among all
files</p>
</dd>
<dt><b>-i</b>, <b>--red</b></dt>
<dd>
<p>Only show lines containing bytes that are different among all
files</p>
</dd>
<dt><b>-U</b>, <b>--blue</b></dt>
<dd>
<p>Only show lines containing bytes that are different among some
files</p>
</dd>
<dt><b>-w</b>, <b>--terse</b></dt>
<dd>
<p>Diff all files, but only display a hex dump of the first file</p>
</dd>
</dl>
<h2>Raw Compression Options:</h2>
<dl>
<dt><b>-X</b>, <b>--deflate</b></dt>
<dd>
<p>Scan for raw deflate compression streams</p>
</dd>
<dt><b>-Z</b>, <b>--lzma</b></dt>
<dd>
<p>Scan for raw LZMA compression streams</p>
</dd>
<dt><b>-P</b>, <b>--partial</b></dt>
<dd>
<p>Perform a superficial, but faster, scan</p>
</dd>
<dt><b>-S</b>, <b>--stop</b></dt>
<dd>
<p>Stop after the first result</p>
</dd>
</dl>
<h2>General Options:</h2>
<dl>
<dt><b>-l</b>, <b>--length=</b>&lt;int&gt;</dt>
<dd>
<p>Number of bytes to scan</p>
</dd>
<dt><b>-o</b>, <b>--offset=</b>&lt;int&gt;</dt>
<dd>
<p>Start scan at this file offset</p>
</dd>
<dt><b>-O</b>, <b>--base=</b>&lt;int&gt;</dt>
<dd>
<p>Add a base address to all printed offsets</p>
</dd>
<dt><b>-K</b>, <b>--block=</b>&lt;int&gt;</dt>
<dd>
<p>Set file block size</p>
</dd>
<dt><b>-g</b>, <b>--swap=</b>&lt;int&gt;</dt>
<dd>
<p>Reverse every n bytes before scanning</p>
</dd>
<dt><b>-f</b>, <b>--log=</b>&lt;file&gt;</dt>
<dd>
<p>Log results to file</p>
</dd>
<dt><b>-c</b>, <b>--csv</b></dt>
<dd>
<p>Log results to file in CSV format</p>
</dd>
<dt><b>-t</b>, <b>--term</b></dt>
<dd>
<p>Format output to fit the terminal window</p>
</dd>
<dt><b>-q</b>, <b>--quiet</b></dt>
<dd>
<p>Suppress output to stdout</p>
</dd>
<dt><b>-v</b>, <b>--verbose</b></dt>
<dd>
<p>Enable verbose output</p>
</dd>
<dt><b>-h</b>, <b>--help</b></dt>
<dd>
<p>Show help output</p>
</dd>
<dt><b>-a</b>, <b>--finclude=</b>&lt;str&gt;</dt>
<dd>
<p>Only scan files whose names match this regex</p>
</dd>
<dt><b>-p</b>, <b>--fexclude=</b>&lt;str&gt;</dt>
<dd>
<p>Do not scan files whose names match this regex</p>
</dd>
<dt><b>-s</b>, <b>--status=</b>&lt;int&gt;</dt>
<dd>
<p>Enable the status server on the specified port</p>
</dd>
</dl>


title: OPTIONS
content:
<dl>
<dt><b>--agent</b></dt>
<dd>
<p>Register agent handler: &lt;capability&gt;</p>
</dd>
<dt><b>--timeout</b></dt>
<dd>
<p>Timeout in seconds for non-interactive mode</p>
</dd>
<dt><b>--version</b></dt>
<dd>
<p>Display version</p>
</dd>
<dt><b>--help</b></dt>
<dd>
<p>Display help</p>
</dd>
</dl>


title: SYNOPSIS
content:
<p><b>protoc</b> [<b>--cpp_out=</b><em>OUT_DIR</em>]
[<b>--java_out=</b><em>OUT_DIR</em>]
[<b>--python_out=</b><em>OUT_DIR</em>]
[<b>-I</b><em>PATH</em> |
<b>--proto_path=</b><em>PATH</em>] <em>PROTO_FILE</em></p>
<p><b>protoc</b> {<b>-h</b> |
<b>--help</b>}</p>
<p><b>protoc</b> <b>--version</b></p>


title: DESCRIPTION
content:
<p><b>protoc</b> is a compiler for protocol buffers
definitions files. It can can generate C++, Java and Python source code
for the classes defined in <em>PROTO_FILE</em>.</p>


title: OPTIONS
content:
<p><b>-I</b><em>PATH</em>,
<b>--proto_path=</b><em>PATH</em></p>
<blockquote>
<p>Specify the directory in which to search for imports. May be
specified multiple times; directories will be searched in order. If not
given, the current working directory is used.</p>
</blockquote>
<p><b>--cpp_out=</b><em>OUT_DIR</em></p>
<blockquote>
<p>Enable generation of C++ bindings and store them in
<em>OUT_DIR</em>.</p>
</blockquote>
<p><b>--java_out=</b><em>OUT_DIR</em></p>
<blockquote>
<p>Enable generation of Java bindings and store them in
<em>OUT_DIR</em>.</p>
</blockquote>
<p><b>--python_out=</b><em>OUT_DIR</em></p>
<blockquote>
<p>Enable generation of Python bindings and store them in
<em>OUT_DIR</em>.</p>
</blockquote>
<p><b>-h</b>, <b>--help</b></p>
<blockquote>
<p>Show summary of options.</p>
</blockquote>
<p><b>--version</b></p>
<blockquote>
<p>Show version of program.</p>
</blockquote>
<p>Note that at least one of the <b>--cpp_out</b>,
<b>--java_out</b> and <b>--python_out</b> options
must be given (otherwise the program has nothing to do). Its also
possible to specify more than one.</p>


title: BUGS
content:
<p>The program currently exits with code 255 for all errors, which makes
it hard to differentiante from scripts the actual error.</p>
<p>The upstream BTS can be found at
<b>https://github.com/protocolbuffers/protobuf/issues</b>.</p>


title: SEE ALSO
content:
<p>More documentation about protocol buffers syntax and APIs is
available online at
<b>https://developers.google.com/protocol-buffers/docs/overview</b>.</p>


title: AUTHOR
content:
<p><b>Iustin Pop</b> &lt;iustin@debian.org&gt;</p>
<blockquote>
<p>Wrote this manpage for the Debian system.</p>
</blockquote>


title: COPYRIGHT
content:
<p><br />
Copyright © 2007 Iustin Pop<br />
</p>
<p>This manual page was written for the Debian system (but may be used
by others).</p>
<p>Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU General Public License, Version 2 or (at your
option) any later version published by the Free Software Foundation.</p>
<p>On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL.</p>


title: SYNOPSIS
content:
<p>ctr</p>
<blockquote>
<pre><code>[--address|-a]=[value]
[--connect-timeout]=[value]
[--debug]
[--namespace|-n]=[value]
[--timeout]=[value]
</code></pre>
</blockquote>
<p><b>Usage</b>:</p>
<blockquote>
<pre><code>ctr [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
</code></pre>
</blockquote>


title: GLOBAL OPTIONS
content:
<p><b>--address, -a</b>="": Address for containerd's GRPC
server (default: /run/containerd/containerd.sock)</p>
<p><b>--connect-timeout</b>="": Timeout for connecting to
containerd (default: 0s)</p>
<p><b>--debug</b>: Enable debug output in logs</p>
<p><b>--namespace, -n</b>="": Namespace to use with commands
(default: default)</p>
<p><b>--timeout</b>="": Total timeout for ctr commands
(default: 0s)</p>


title: plugins, plugin
content:
<p>Provides information about containerd plugins</p>
<h2>list, ls</h2>
<p>Lists containerd plugins</p>
<p><b>--detailed, -d</b>: Print detailed information about
each plugin</p>
<p><b>--quiet, -q</b>: Print only the plugin ids</p>


title: containers, c, container
content:
<p>Manage containers</p>
<h2>create</h2>
<p>Create container</p>
<p><b>--allow-new-privs</b>: Turn off OCI spec's
NoNewPrivileges feature flag</p>
<p><b>--annotation</b>="": Specify additional OCI annotations
(e.g. foo=bar)</p>
<p><b>--apparmor-default-profile</b>="": Enable AppArmor with
the default profile with the specified name, e.g.
"cri-containerd.apparmor.d"</p>
<p><b>--apparmor-profile</b>="": Enable AppArmor with an
existing custom profile</p>
<p><b>--blockio-class</b>="": Name of the blockio class to
associate the container with</p>
<p><b>--blockio-config-file</b>="": File path to blockio class
definitions. By default class definitions are not loaded.</p>
<p><b>--cap-add</b>="": Add Linux capabilities (Set
capabilities with 'CAP_' prefix)</p>
<p><b>--cap-drop</b>="": Drop Linux capabilities (Set
capabilities with 'CAP_' prefix)</p>
<p><b>--config, -c</b>="": Path to the runtime-specific spec
config file</p>
<p><b>--cpu-period</b>="": Limit CPU CFS period (default:
0)</p>
<p><b>--cpu-quota</b>="": Limit CPU CFS quota (default:
-1)</p>
<p><b>--cwd</b>="": Specify the working directory of the
process</p>
<p><b>--device</b>="": File path to a device to add to the
container; or a path to a directory tree of devices to add to the
container</p>
<p><b>--env</b>="": Specify additional container environment
variables (e.g. FOO=bar)</p>
<p><b>--env-file</b>="": Specify additional container
environment variables in a file(e.g. FOO=bar, one per line)</p>
<p><b>--gpus</b>="": Add gpus to the container</p>
<p><b>--hostname</b>="": Set the container's host name</p>
<p><b>--label</b>="": Specify additional labels (e.g.
foo=bar)</p>
<p><b>--memory-limit</b>="": Memory limit (in bytes) for the
container (default: 0)</p>
<p><b>--mount</b>="": Specify additional container mount (e.g.
type=bind,src=/tmp,dst=/host,options=rbind:ro)</p>
<p><b>--net-host</b>: Enable host networking for the
container</p>
<p><b>--no-pivot</b>: Disable use of pivot-root (linux
only)</p>
<p><b>--pid-file</b>="": File path to write the task's pid</p>
<p><b>--privileged</b>: Run privileged container</p>
<p><b>--rdt-class</b>="": Name of the RDT class to associate
the container with. Specifies a Class of Service (CLOS) for cache and
memory bandwidth management.</p>
<p><b>--read-only</b>: Set the containers filesystem as
readonly</p>
<p><b>--rootfs</b>: Use custom rootfs that is not managed by
containerd snapshotter</p>
<p><b>--rootfs-propagation</b>="": Set the propagation of the
container rootfs</p>
<p><b>--runtime</b>="": Runtime name or absolute path to
runtime binary (default: io.containerd.runc.v2)</p>
<p><b>--runtime-config-path</b>="": Optional runtime config
path</p>
<p><b>--seccomp</b>: Enable the default seccomp profile</p>
<p><b>--seccomp-profile</b>="": File path to custom seccomp
profile. seccomp must be set to true, before using seccomp-profile</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<p><b>--snapshotter-label</b>="": Labels added to the new
snapshot for this container.</p>
<p><b>--tty, -t</b>: Allocate a TTY for the container</p>
<p><b>--user, -u</b>="": Username or user id, group optional
(format: [:])</p>
<p><b>--with-ns</b>="": Specify existing Linux namespaces to
join at container runtime (format ':')</p>
<h2>delete, del, remove, rm</h2>
<p>Delete one or more existing containers</p>
<p><b>--keep-snapshot</b>: Do not clean up snapshot with
container</p>
<h2>info</h2>
<p>Get info about a container</p>
<p><b>--spec</b>: Only display the spec</p>
<h2>list, ls</h2>
<p>List containers</p>
<p><b>--quiet, -q</b>: Print only the container id</p>
<h2>label</h2>
<p>Set and clear labels for a container</p>
<h2>checkpoint</h2>
<p>Checkpoint a container</p>
<p><b>--image</b>: Include the image in the checkpoint</p>
<p><b>--rw</b>: Include the rw layer in the checkpoint</p>
<p><b>--task</b>: Checkpoint container task</p>
<h2>restore</h2>
<p>Restore a container from checkpoint</p>
<p><b>--live</b>: Restore the runtime and memory data from the
checkpoint</p>
<p><b>--rw</b>: Restore the rw layer from the checkpoint</p>


title: content
content:
<p>Manage content</p>
<h2>active</h2>
<p>Display active transfers</p>
<p><b>--root</b>="": Path to content store root (default:
/tmp/content)</p>
<p><b>--timeout, -t</b>="": Total timeout for fetch (default:
0s)</p>
<h2>delete, del, remove, rm</h2>
<p>Permanently delete one or more blobs</p>
<h2>edit</h2>
<p>Edit a blob and return a new digest</p>
<p><b>--editor</b>="": Select editor (vim, emacs, etc.)</p>
<p><b>--validate</b>="": Validate the result against a format
(json, mediatype, etc.)</p>
<h2>fetch</h2>
<p>Fetch all content for an image into containerd</p>
<p><b>--all-metadata</b>: Pull metadata for all platforms</p>
<p><b>--all-platforms</b>: Pull content from all platforms</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--label</b>="": Labels to attach to the image</p>
<p><b>--metadata-only</b>: Pull all metadata including
manifests and configs</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--platform</b>="": Pull content from a specific
platform</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>fetch-object</h2>
<p>Retrieve objects from a remote</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>fetch-blob</h2>
<p>Retrieve blobs from a remote</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>get</h2>
<p>Get the data for an object</p>
<h2>ingest</h2>
<p>Accept content into the store</p>
<p><b>--expected-digest</b>="": Verify content against
expected digest</p>
<p><b>--expected-size</b>="": Validate against provided size
(default: 0)</p>
<h2>list, ls</h2>
<p>List all blobs in the store</p>
<p><b>--quiet, -q</b>: Print only the blob digest</p>
<h2>push-object</h2>
<p>Push an object to a remote</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>label</h2>
<p>Add labels to content</p>
<h2>prune</h2>
<p>Prunes content from the content store</p>
<h2>references</h2>
<p>Prunes preference labels from the content store (layers only by
default)</p>
<p><b>--async</b>: Allow garbage collection to cleanup
asynchronously</p>
<p><b>--dry</b>: Just show updates without applying (enables
debug logging)</p>


title: images, image, i
content:
<p>Manage images</p>
<h2>check</h2>
<p>Check existing images to ensure all content is available locally</p>
<p><b>--quiet, -q</b>: Print only the ready image refs (fully
downloaded and unpacked)</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<h2>export</h2>
<p>Export images</p>
<p><b>--all-platforms</b>: Exports content from all
platforms</p>
<p><b>--local</b>: Run export locally rather than through
transfer API</p>
<p><b>--platform</b>="": Pull content from a specific
platform</p>
<p><b>--skip-manifest-json</b>: Do not add Docker compatible
manifest.json to archive</p>
<p><b>--skip-non-distributable</b>: Do not add
non-distributable blobs such as Windows layers to archive</p>
<h2>import</h2>
<p>Import images</p>
<p><b>--all-platforms</b>: Imports content for all platforms,
false by default</p>
<p><b>--base-name</b>="": Base image name for added images,
when provided only images with this name prefix are imported</p>
<p><b>--compress-blobs</b>: Compress uncompressed blobs when
creating manifest (Docker format only)</p>
<p><b>--digests</b>: Whether to create digest images (default:
false)</p>
<p><b>--discard-unpacked-layers</b>: Allow the garbage
collector to clean layers up from the content store after unpacking,
cannot be used with --no-unpack, false by default</p>
<p><b>--index-name</b>="": Image name to keep index as, by
default index is discarded</p>
<p><b>--local</b>: Run import locally rather than through
transfer API</p>
<p><b>--no-unpack</b>: Skip unpacking the images, cannot be
used with --discard-unpacked-layers, false by default</p>
<p><b>--platform</b>="": Imports content for specific
platform</p>
<p><b>--skip-digest-for-named</b>: Skip applying --digests
option to images named in the importing tar (use it in conjunction with
--digests)</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<h2>list, ls</h2>
<p>List images known to containerd</p>
<p><b>--quiet, -q</b>: Print only the image refs</p>
<h2>mount</h2>
<p>Mount an image to a target path</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--label</b>="": Labels to attach to the image</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--platform</b>="": Mount the image for the specified
platform (default: linux/amd64)</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--rw</b>: Enable write support on the mount</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>unmount</h2>
<p>Unmount the image from the target</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--label</b>="": Labels to attach to the image</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--rm</b>: Remove the snapshot after a successful
unmount</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>pull</h2>
<p>Pull an image from a remote</p>
<p><b>--all-metadata</b>: Pull metadata for all platforms</p>
<p><b>--all-platforms</b>: Pull content and metadata from all
platforms</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--label</b>="": Labels to attach to the image</p>
<p><b>--local</b>: Fetch content from local client rather than
using transfer service</p>
<p><b>--max-concurrent-downloads</b>="": Set the max
concurrent downloads for each pull (default: 0)</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--platform</b>="": Pull content from a specific
platform</p>
<p><b>--print-chainid</b>: Print the resulting image's chain
ID</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>push</h2>
<p>Push an image to a remote</p>
<p><b>--allow-non-distributable-blobs</b>: Allow pushing blobs
that are marked as non-distributable</p>
<p><b>--hosts-dir</b>="": Custom hosts configuration
directory</p>
<p><b>--http-dump</b>: Dump all HTTP request/responses when
interacting with container registry</p>
<p><b>--http-trace</b>: Enable HTTP tracing for registry
interactions</p>
<p><b>--local</b>: Push content from local client rather than
using transfer service</p>
<p><b>--manifest</b>="": Digest of manifest</p>
<p><b>--manifest-type</b>="": Media type of manifest digest
(default: application/vnd.oci.image.manifest.v1+json)</p>
<p><b>--max-concurrent-uploaded-layers</b>="": Set the max
concurrent uploaded layers for each push (default: 0)</p>
<p><b>--plain-http</b>: Allow connections using plain HTTP</p>
<p><b>--platform</b>="": Push content from a specific
platform</p>
<p><b>--refresh</b>="": Refresh token for authorization
server</p>
<p><b>--skip-verify, -k</b>: Skip SSL certificate
validation</p>
<p><b>--tlscacert</b>="": Path to TLS root CA</p>
<p><b>--tlscert</b>="": Path to TLS client certificate</p>
<p><b>--tlskey</b>="": Path to TLS client key</p>
<p><b>--user, -u</b>="": User[:password] Registry user and
password</p>
<h2>prune</h2>
<p>Remove unused images</p>
<p><b>--all</b>: Remove all unused images, not just dangling
ones (if all is not specified no images will be pruned)</p>
<h2>delete, del, remove, rm</h2>
<p>Remove one or more images by reference</p>
<p><b>--sync</b>: Synchronously remove image and all
associated resources</p>
<h2>tag</h2>
<p>Tag an image</p>
<p><b>--force</b>: Force target_ref to be created, regardless
if it already exists</p>
<p><b>--local</b>: Run tag locally rather than through
transfer API</p>
<h2>label</h2>
<p>Set and clear labels for an image</p>
<p><b>--replace-all, -r</b>: Replace all labels</p>
<h2>convert</h2>
<p>Convert an image</p>
<p><b>--all-platforms</b>: Exports content from all
platforms</p>
<p><b>--oci</b>: Convert Docker media types to OCI media
types</p>
<p><b>--platform</b>="": Pull content from a specific
platform</p>
<p><b>--uncompress</b>: Convert tar.gz layers to uncompressed
tar layers</p>
<h2>usage</h2>
<p>Display usage of snapshots for a given image ref</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>


title: leases
content:
<p>Manage leases</p>
<h2>list, ls</h2>
<p>List all active leases</p>
<p><b>--quiet, -q</b>: Print only the blob digest</p>
<h2>create</h2>
<p>Create lease</p>
<p><b>--expires, -x</b>="": Expiration of lease (0 value will
not expire) (default: 24h0m0s)</p>
<p><b>--id</b>="": Set the id for the lease, will be generated
by default</p>
<h2>delete, del, remove, rm</h2>
<p>Delete a lease</p>
<p><b>--sync</b>: Synchronously remove leases and all
unreferenced resources</p>


title: namespaces, namespace, ns
content:
<p>Manage namespaces</p>
<h2>create, c</h2>
<p>Create a new namespace</p>
<h2>list, ls</h2>
<p>List namespaces</p>
<p><b>--quiet, -q</b>: Print only the namespace name</p>
<h2>remove, rm</h2>
<p>Remove one or more namespaces</p>
<p><b>--cgroup, -c</b>: Delete the namespace's cgroup</p>
<h2>label</h2>
<p>Set and clear labels for a namespace</p>


title: pprof
content:
<p>Provide golang pprof outputs for containerd</p>
<p><b>--debug-socket, -d</b>="": Socket path for containerd's
debug server (default: /run/containerd/debug.sock)</p>
<h2>block</h2>
<p>Goroutine blocking profile</p>
<p><b>--debug</b>="": Debug pprof args (default: 0)</p>
<h2>goroutines</h2>
<p>Dump goroutine stack dump</p>
<p><b>--debug</b>="": Debug pprof args (default: 2)</p>
<h2>heap</h2>
<p>Dump heap profile</p>
<p><b>--debug</b>="": Debug pprof args (default: 0)</p>
<h2>profile</h2>
<p>CPU profile</p>
<p><b>--debug</b>="": Debug pprof args (default: 0)</p>
<p><b>--seconds, -s</b>="": Duration for collection (seconds)
(default: 30s)</p>
<h2>threadcreate</h2>
<p>Goroutine thread creating profile</p>
<p><b>--debug</b>="": Debug pprof args (default: 0)</p>
<h2>trace</h2>
<p>Collect execution trace</p>
<p><b>--debug</b>="": Debug pprof args (default: 0)</p>
<p><b>--seconds, -s</b>="": Trace time (seconds) (default:
5s)</p>


title: run
content:
<p>Run a container</p>
<p><b>--allow-new-privs</b>: Turn off OCI spec's
NoNewPrivileges feature flag</p>
<p><b>--annotation</b>="": Specify additional OCI annotations
(e.g. foo=bar)</p>
<p><b>--apparmor-default-profile</b>="": Enable AppArmor with
the default profile with the specified name, e.g.
"cri-containerd.apparmor.d"</p>
<p><b>--apparmor-profile</b>="": Enable AppArmor with an
existing custom profile</p>
<p><b>--blockio-class</b>="": Name of the blockio class to
associate the container with</p>
<p><b>--blockio-config-file</b>="": File path to blockio class
definitions. By default class definitions are not loaded.</p>
<p><b>--cap-add</b>="": Add Linux capabilities (Set
capabilities with 'CAP_' prefix)</p>
<p><b>--cap-drop</b>="": Drop Linux capabilities (Set
capabilities with 'CAP_' prefix)</p>
<p><b>--cgroup</b>="": Cgroup path (To disable use of cgroup,
set to "" explicitly)</p>
<p><b>--cni</b>: Enable cni networking for the container</p>
<p><b>--config, -c</b>="": Path to the runtime-specific spec
config file</p>
<p><b>--cpu-period</b>="": Limit CPU CFS period (default:
0)</p>
<p><b>--cpu-quota</b>="": Limit CPU CFS quota (default:
-1)</p>
<p><b>--cpu-shares</b>="": Set the cpu shares (default:
1024)</p>
<p><b>--cpus</b>="": Set the CFS cpu quota (default:
0.000000)</p>
<p><b>--cwd</b>="": Specify the working directory of the
process</p>
<p><b>--detach, -d</b>: Detach from the task after it has
started execution, cannot be used with --rm</p>
<p><b>--device</b>="": File path to a device to add to the
container; or a path to a directory tree of devices to add to the
container</p>
<p><b>--env</b>="": Specify additional container environment
variables (e.g. FOO=bar)</p>
<p><b>--env-file</b>="": Specify additional container
environment variables in a file(e.g. FOO=bar, one per line)</p>
<p><b>--fifo-dir</b>="": Directory used for storing IO
FIFOs</p>
<p><b>--gidmap</b>="": Run inside a user namespace with the
specified GID mapping range; specified with the format
<code>container-gid:host-gid:length</code></p>
<p><b>--gpus</b>="": Add gpus to the container</p>
<p><b>--hostname</b>="": Set the container's host name</p>
<p><b>--label</b>="": Specify additional labels (e.g.
foo=bar)</p>
<p><b>--log-uri</b>="": Log uri</p>
<p><b>--memory-limit</b>="": Memory limit (in bytes) for the
container (default: 0)</p>
<p><b>--mount</b>="": Specify additional container mount (e.g.
type=bind,src=/tmp,dst=/host,options=rbind:ro)</p>
<p><b>--net-host</b>: Enable host networking for the
container</p>
<p><b>--no-pivot</b>: Disable use of pivot-root (linux
only)</p>
<p><b>--null-io</b>: Send all IO to /dev/null</p>
<p><b>--pid-file</b>="": File path to write the task's pid</p>
<p><b>--platform</b>="": Run image for specific platform</p>
<p><b>--privileged</b>: Run privileged container</p>
<p><b>--privileged-without-host-devices</b>: Don't pass all
host devices to privileged container</p>
<p><b>--rdt-class</b>="": Name of the RDT class to associate
the container with. Specifies a Class of Service (CLOS) for cache and
memory bandwidth management.</p>
<p><b>--read-only</b>: Set the containers filesystem as
readonly</p>
<p><b>--remap-labels</b>: Provide the user namespace ID
remapping to the snapshotter via label options; requires snapshotter
support</p>
<p><b>--rm</b>: Remove the container after running, cannot be
used with --detach</p>
<p><b>--rootfs</b>: Use custom rootfs that is not managed by
containerd snapshotter</p>
<p><b>--rootfs-propagation</b>="": Set the propagation of the
container rootfs</p>
<p><b>--runc-binary</b>="": Specify runc-compatible binary</p>
<p><b>--runc-root</b>="": Specify runc-compatible root</p>
<p><b>--runc-systemd-cgroup</b>: Start runc with systemd
cgroup manager</p>
<p><b>--runtime</b>="": Runtime name or absolute path to
runtime binary (default: io.containerd.runc.v2)</p>
<p><b>--runtime-config-path</b>="": Optional runtime config
path</p>
<p><b>--seccomp</b>: Enable the default seccomp profile</p>
<p><b>--seccomp-profile</b>="": File path to custom seccomp
profile. seccomp must be set to true, before using seccomp-profile</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<p><b>--snapshotter-label</b>="": Labels added to the new
snapshot for this container.</p>
<p><b>--tty, -t</b>: Allocate a TTY for the container</p>
<p><b>--uidmap</b>="": Run inside a user namespace with the
specified UID mapping range; specified with the format
<code>container-uid:host-uid:length</code></p>
<p><b>--user, -u</b>="": Username or user id, group optional
(format: [:])</p>
<p><b>--with-ns</b>="": Specify existing Linux namespaces to
join at container runtime (format ':')</p>


title: snapshots, snapshot
content:
<p>Manage snapshots</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<h2>commit</h2>
<p>Commit an active snapshot into the provided name</p>
<h2>diff</h2>
<p>Get the diff of two snapshots. the default second snapshot is the
first snapshot's parent.</p>
<p><b>--keep</b>: Keep diff content. up to creator to delete
it.</p>
<p><b>--label</b>="": Labels to attach to the image</p>
<p><b>--media-type</b>="": Media type to use for creating diff
(default: application/vnd.oci.image.layer.v1.tar+gzip)</p>
<p><b>--ref</b>="": Content upload reference to use</p>
<h2>info</h2>
<p>Get info about a snapshot</p>
<h2>list, ls</h2>
<p>List snapshots</p>
<h2>mounts, m, mount</h2>
<p>Mount gets mount commands for the snapshots</p>
<h2>prepare</h2>
<p>Prepare a snapshot from a committed snapshot</p>
<p><b>--mounts</b>: Print out snapshot mounts as JSON</p>
<p><b>--target, -t</b>="": Mount target path, will print
mount, if provided</p>
<h2>delete, del, remove, rm</h2>
<p>Remove snapshots</p>
<h2>label</h2>
<p>Add labels to content</p>
<h2>tree</h2>
<p>Display tree view of snapshot branches</p>
<h2>unpack</h2>
<p>Unpack applies layers from a manifest to a snapshot</p>
<p><b>--snapshotter</b>="": Snapshotter name. Empty value
stands for the default value.</p>
<h2>usage</h2>
<p>Usage snapshots</p>
<p><b>-b</b>: Display size in bytes</p>
<h2>view</h2>
<p>Create a read-only snapshot from a committed snapshot</p>
<p><b>--mounts</b>: Print out snapshot mounts as JSON</p>
<p><b>--target, -t</b>="": Mount target path, will print
mount, if provided</p>


title: tasks, t, task
content:
<p>Manage tasks</p>
<h2>attach</h2>
<p>Attach to the IO of a running container</p>
<h2>checkpoint</h2>
<p>Checkpoint a container</p>
<p><b>--exit</b>: Stop the container after the checkpoint</p>
<p><b>--image-path</b>="": Path to criu image files</p>
<p><b>--work-path</b>="": Path to criu work files and logs</p>
<h2>delete, del, remove, rm</h2>
<p>Delete one or more tasks</p>
<p><b>--exec-id</b>="": Process ID to kill</p>
<p><b>--force, -f</b>: Force delete task process</p>
<h2>exec</h2>
<p>Execute additional processes in an existing container</p>
<p><b>--cwd</b>="": Working directory of the new process</p>
<p><b>--detach, -d</b>: Detach from the task after it has
started execution</p>
<p><b>--exec-id</b>="": Exec specific id for the process</p>
<p><b>--fifo-dir</b>="": Directory used for storing IO
FIFOs</p>
<p><b>--log-uri</b>="": Log uri for custom shim logging</p>
<p><b>--tty, -t</b>: Allocate a TTY for the container</p>
<p><b>--user</b>="": User id or name</p>
<h2>list, ls</h2>
<p>List tasks</p>
<p><b>--quiet, -q</b>: Print only the task id</p>
<h2>kill</h2>
<p>Signal a container (default: SIGTERM)</p>
<p><b>--all, -a</b>: Send signal to all processes inside the
container</p>
<p><b>--exec-id</b>="": Process ID to kill</p>
<p><b>--signal, -s</b>="": Signal to send to the container</p>
<h2>metrics, metric</h2>
<p>Get a single data point of metrics for a task with the built-in Linux
runtime</p>
<p><b>--format</b>="": "table" or "json" (default: table)</p>
<h2>pause</h2>
<p>Pause an existing container</p>
<h2>ps</h2>
<p>List processes for container</p>
<h2>resume</h2>
<p>Resume a paused container</p>
<h2>start</h2>
<p>Start a container that has been created</p>
<p><b>--detach, -d</b>: Detach from the task after it has
started execution</p>
<p><b>--fifo-dir</b>="": Directory used for storing IO
FIFOs</p>
<p><b>--log-uri</b>="": Log uri</p>
<p><b>--no-pivot</b>: Disable use of pivot-root (linux
only)</p>
<p><b>--null-io</b>: Send all IO to /dev/null</p>
<p><b>--pid-file</b>="": File path to write the task's pid</p>


title: install
content:
<p>Install a new package</p>
<p><b>--libs, -l</b>: Install libs from the image</p>
<p><b>--path</b>="": Set an optional install path other than
the managed opt directory</p>
<p><b>--replace, -r</b>: Replace any binaries or libs in the
opt directory</p>


title: oci
content:
<p>OCI tools</p>
<h2>spec</h2>
<p>See the output of the default OCI spec</p>
<p><b>--platform</b>="": Platform of the spec to print
(Examples: 'linux/arm64', 'windows/amd64')</p>


title: sandboxes, sandbox, sb, s
content:
<p>Manage sandboxes</p>
<h2>run, create, c, r</h2>
<p>Run a new sandbox</p>
<p><b>--runtime</b>="": Runtime name (default:
io.containerd.runc.v2)</p>
<h2>list, ls</h2>
<p>List sandboxes</p>
<p><b>--filters</b>="": The list of filters to apply when
querying sandboxes from the store</p>
<h2>remove, rm</h2>
<p>Remove sandboxes</p>
<p><b>--force, -f</b>: Ignore shutdown errors when removing
sandbox</p>


title: shim
content:
<p>Interact with a shim directly</p>
<p><b>--id</b>="": Container id</p>
<h2>delete</h2>
<p>Delete a container with a task</p>
<h2>exec</h2>
<p>Exec a new process in the task's container</p>
<p><b>--attach, -a</b>: Stay attached to the container and
open the fifos</p>
<p><b>--cwd</b>="": Current working directory</p>
<p><b>--env, -e</b>="": Add environment vars</p>
<p><b>--spec</b>="": Runtime spec</p>
<p><b>--stderr</b>="": Specify the path to the stderr fifo</p>
<p><b>--stdin</b>="": Specify the path to the stdin fifo</p>
<p><b>--stdout</b>="": Specify the path to the stdout fifo</p>
<p><b>--tty, -t</b>: Enable tty support</p>
<h2>start</h2>
<p>Start a container with a task</p>
<h2>state</h2>
<p>Get the state of all the processes of the task</p>


title: TLDR
content:
<b>Log only HTTPS POST traffic on port 10000 by default</b>`sslstrip`<br><b>Log only HTTPS POST traffic on port 8080</b>`sslstrip --listen=[8080]`<br><b>Log all SSL traffic to and from the server on port 8080</b>`sslstrip --ssl --listen=[8080]`<br><b>Log all SSL and HTTP traffic to and from the server on port 8080</b>`sslstrip --listen=[8080] --all`<br><b>Specify the file path to store the logs</b>`sslstrip --listen=[8080] --write=[path/to/file]`<br><b>Display help</b>`sslstrip --help`


title: TLDR
content:
<b>Copy data to another file</b>`objcopy [path/to/source_file] [path/to/target_file]`<br><b>Translate object files from one format to another</b>`objcopy --input-target=[input_format] --output-target [output_format] [path/to/source_file] [path/to/target_file]`<br><b>Strip all symbol information from the file</b>`objcopy --strip-all [path/to/source_file] [path/to/target_file]`<br><b>Strip debugging information from the file</b>`objcopy --strip-debug [path/to/source_file] [path/to/target_file]`<br><b>Copy a specific section from the source file to the destination file</b>`objcopy --only-section [section] [path/to/source_file] [path/to/target_file]`


title: TLDR
content:
<b>Move /proc, /dev, /sys and /run to the specified filesystem, use this filesystem as the new root and start the specified init process</b>`switch_root [new_root] [/sbin/init]`<br><b>Display help</b>`switch_root [[-h|--help]]`


title: TLDR
content:
<b>View keycodes in decimal</b>`sudo showkey`<br><b>Display scancodes in hexadecimal</b>`sudo showkey [[-s|--scancodes]]`<br><b>Display keycodes in decimal (default)</b>`sudo showkey [[-k|--keycodes]]`<br><b>Display keycodes in ASCII, decimal, and hexadecimal</b>`sudo showkey [[-a|--ascii]]`<br><b>Exit the program</b>`<Ctrl d>`


title: TLDR
content:
<b>Route traffic via Tor</b>`torify [command]`<br><b>Toggle Tor in shell</b>`torify [on|off]`<br><b>Spawn a Tor-enabled shell</b>`torify --shell`<br><b>Check for a Tor-enabled shell</b>`torify show`<br><b>Specify Tor configuration file</b>`torify -c [config-file] [command]`<br><b>Use a specific Tor SOCKS proxy</b>`torify -P [proxy] [command]`<br><b>Redirect output to a file</b>`torify [command] > [path/to/output]`


title: TLDR
content:
<b>Check the status of a parallel port device</b>`tunelp [[-s|--status]] [/dev/lp0]`<br><b>Reset a given parallel port</b>`tunelp [[-r|--reset]] [/dev/lp0]`<br><b>Use a given IRQ for a device, each one representing an interrupt line</b>`tunelp [[-i|--irq]] 5 [/dev/lp0]`<br><b>Try a given number of times to output a character to the printer before sleeping for a given time</b>`tunelp [[-c|--chars]] [times] [[-t|--time]] [time_in_centiseconds] [/dev/lp0]`<br><b>Enable or disable aborting on error (disabled by default)</b>`tunelp [[-a|--abort]] [on|off]`


title: TLDR
content:
<b>Show only [a]ctive containers</b>`ctop -a`<br><b>[r]everse the container sort order</b>`ctop -r`<br><b>[i]nvert the default colors</b>`ctop -i`<br><b>Display [h]elp</b>`ctop -h`


title: TLDR
content:
<b>Start the ydotool daemon in the background</b>`ydotoold`<br><b>Perform a <LeftClick> input</b>`ydotool click 0xC0`<br><b>Perform a <RightClick> input</b>`ydotool click 0xC1`<br><b>Input <Alt F4></b>`ydotool key 56:1 62:1 62:0 56:0`


title: TLDR
content:
<b>Display the list of access points and ad-hoc cells in range</b>`iwlist [wireless_interface] scan`<br><b>Display available frequencies in the device</b>`iwlist [wireless_interface] frequency`<br><b>List the bit-rates supported by the device</b>`iwlist [wireless_interface] rate`<br><b>List the WPA authentication parameters currently set</b>`iwlist [wireless_interface] auth`<br><b>List all the WPA encryption keys set in the device</b>`iwlist [wireless_interface] wpakeys`<br><b>List the encryption key sizes supported and list all the encryption keys set in the device</b>`iwlist [wireless_interface] keys`<br><b>List the various power management attributes and modes of the device</b>`iwlist [wireless_interface] power`<br><b>List generic information elements set in the device (used for WPA support)</b>`iwlist [wireless_interface] genie`


title: TLDR
content:
<b>Search for lines beginning with a specific prefix in a specific file</b>`look [prefix] [path/to/file]`<br><b>Case-insensitively search only on alphanumeric characters</b>`look [[-f|--ignore-case]] [[-d|--alphanum]] [prefix] [path/to/file]`<br><b>Specify a string termination character (space by default)</b>`look [[-t|--terminate]] [,]`<br><b>Search in /usr/share/dict/words (--alphanum and --ignore-case are assumed)</b>`look [prefix]`


title: TLDR
content:
<b>Display the current configuration values</b>`cupsctl`<br><b>Display the configuration values of a specific server</b>`cupsctl -h [server[:port]]`<br><b>Enable encryption on the connection to the scheduler</b>`cupsctl -E`<br><b>Enable or disable debug logging to the error_log file</b>`cupsctl [--debug-logging|--no-debug-logging]`<br><b>Enable or disable remote administration</b>`cupsctl [--remote-admin|--no-remote-admin]`<br><b>Parse the current debug logging state</b>`cupsctl | grep '^_debug_logging' | awk -F= '{print $2}'`


title: TLDR
content:
<b>Show the queued jobs of the default destination</b>`lpq`<br><b>Show the queued jobs of all printers enforcing encryption</b>`lpq -a -E`<br><b>Show the queued jobs in a long format</b>`lpq -l`<br><b>Show the queued jobs of a specific printer or class</b>`lpq -P [destination]/[instance]`<br><b>Show the queued jobs once every n seconds until the queue is empty</b>`lpq +[interval]`


title: TLDR
content:
<b>Move a specific job to new_printer</b>`lpmove [job_id] [new_printer]`<br><b>Move a job from old_printer to new_printer</b>`lpmove [old_printer]-[job_id] [new_printer]`<br><b>Move all jobs from old_printer to new_printer</b>`lpmove [old_printer] [new_printer]`<br><b>Move a specific job to new_printer on a specific server</b>`lpmove -h [server] [job_id] [new_printer]`


title: TLDR
content:
<b>List IPP printers registered on the network with their status</b>`ippfind [[-l|--ls]]`<br><b>Send a specific PostScript document to every PostScript printer on the network</b>`ippfind --txt-pdl application/postscript [[-x|--exec]] ipptool -f [path/to/document.ps] '{}' print-job.test \;`<br><b>Send a PostScript test document to every PostScript printer on the network</b>`ippfind --txt-pdl application/postscript [[-x|--exec]] ipptool -f onepage-letter.ps '{}' print-job.test \;`<br><b>Send a PostScript test document to every PostScript printer on the network, whose name matches a regex</b>`ippfind --txt-pdl application/postscript [[-h|--host]] [regex] [[-x|--exec]] ipptool -f onepage-letter.ps '{}' print-job.test \;`


title: TLDR
content:
<b>Accept print jobs to the specified destinations</b>`cupsaccept [destination1 destination2 ...]`<br><b>Specify a different server</b>`cupsaccept -h [server] [destination1 destination2 ...]`


title: TLDR
content:
<b>Verify a packed Git archive file</b>`git verify-pack [path/to/pack-file]`<br><b>Verify a packed Git archive file and show verbose details</b>`git verify-pack [[-v|--verbose]] [path/to/pack-file]`<br><b>Verify a packed Git archive file and only display the statistics</b>`git verify-pack [[-s|--stat-only]] [path/to/pack-file]`


title: TLDR
content:
<b>Build a tree object and verify that each tree entry's hash identifies an existing object</b>`git mktree`<br><b>Allow missing objects</b>`git mktree --missing`<br><b>Read the NUL ([z]ero character) terminated output of the tree object (git ls-tree -z)</b>`git mktree -z`<br><b>Allow the creation of multiple tree objects</b>`git mktree --batch`<br><b>Sort and build a tree from stdin (non-recursive git ls-tree output format is required)</b>`git < [path/to/tree.txt] mktree`


title: TLDR
content:
<b>Start one or more destination(s)</b>`cupsenable [destination1 destination2 ...]`<br><b>Resume printing of pending jobs of a destination (use after cupsdisable with --hold)</b>`cupsenable --release [destination]`<br><b>Cancel all jobs of the specified destination(s)</b>`cupsenable -c [destination1 destination2 ...]`


title: TLDR
content:
<b>Display a cursor to select a window to display its attributes (id, name, size, position, ...)</b>`xwininfo`<br><b>Display the tree of all windows</b>`xwininfo -tree -root`<br><b>Display the attributes of a window with a specific ID</b>`xwininfo -id [id]`<br><b>Display the attributes of a window with a specific name</b>`xwininfo -name [name]`<br><b>Display the ID of a window searching by name</b>`xwininfo -tree -root | grep [keyword] | head -1 | perl -ne 'print $1 if /(0x[\da-f]+)/ig;'`


title: TLDR
content:
<b>Test the conformance of one or more files in quiet mode</b>`cupstestppd -q [path/to/file1.ppd path/to/file2.ppd ...]`<br><b>Get the PPD file from stdin, showing detailed conformance testing results</b>`cupstestppd < [path/to/file.ppd] -v -`<br><b>Test all PPD files under the current directory, printing the names of each file that does not conform</b>`find . -name \*.ppd \! -execdir cupstestppd -q '{}' \; -print`


title: TLDR
content:
<b>Get all attributes and their values supported by a printer</b>`ipptool ipp://[printer_uri] get-completed-jobs.test`<br><b>Get the list of completed jobs of a printer</b>`ipptool ipp://[printer_uri] get-completed-jobs.test`<br><b>Send an email notification when a printer changes</b>`ipptool -d recipient=mailto:[email] ipp://[printer_uri] create-printer-subscription.test`


title: TLDR
content:
<b>Create a tree object from the current index</b>`git write-tree`<br><b>Create a tree object without checking whether objects referenced by the directory exist in the object database</b>`git write-tree --missing-ok`<br><b>Create a tree object that represents a subdirectory (used to write the tree object for a subproject in the named subdirectory)</b>`git write-tree --prefix [subdirectory]/`


title: TLDR
content:
<b>Set the default printer</b>`lpoptions -d [printer]/[instance]`<br><b>List printer-specific options of a specific printer</b>`lpoptions -d [printer] -l`<br><b>Set a new option on a specific printer</b>`lpoptions -d [printer] -o [option]`<br><b>Remove the options of a specific printer</b>`lpoptions -d [printer] -x`


title: TLDR
content:
<b>Cancel the current job of the default printer (set with lpoptions -d printer_name)</b>`cancel`<br><b>Cancel the jobs of the default printer owned by a specific [u]ser</b>`cancel -u [username]`<br><b>Cancel the current job of a specific printer</b>`cancel [printer]`<br><b>Cancel a specific job from a specific printer</b>`cancel [printer]-[job_id]`<br><b>Cancel [a]ll jobs of all printers</b>`cancel -a`<br><b>Cancel [a]ll jobs of a specific printer</b>`cancel -a [printer]`<br><b>Cancel the current job of a specific [h]ost server and then delete ([x]) job data files</b>`cancel -h [server] -x`


title: TLDR
content:
<b>Launch the console</b>`msfconsole`<br><b>Launch the console quietly without any banner</b>`msfconsole [[-q|--quiet]]`<br><b>Do not enable database support</b>`msfconsole [[-n|--no-database]]`<br><b>Execute console commands (Note: Use ; for passing multiple commands)</b>`msfconsole [[-x|--execute-command]] "[use auxiliary/server/capture/ftp; set SRVHOST 0.0.0.0; set SRVPORT 21; run]"`<br><b>Display help</b>`msfconsole [[-h|--help]]`<br><b>Display version</b>`msfconsole [[-v|--version]]`


title: TLDR
content:
<b>Scan for possible queries using interactive mode</b>`sg scan --interactive`<br><b>Rewrite code in the current directory using patterns</b>`sg run --pattern '[foo]' --rewrite '[bar]' --lang [python]`<br><b>Visualize possible changes without applying them</b>`sg run --pattern '[useState<number>($A)]' --rewrite '[useState($A)]' --lang [typescript]`<br><b>Output results as JSON, extract information using jq and interactively view it using jless</b>`sg run --pattern '[Some($A)]' --rewrite '[None]' --json | jq '[.[].replacement]' | jless`


title: TLDR
content:
<b>Cancel current job on the default printer</b>`lprm`<br><b>Cancel a job of a specific server</b>`lprm -h [server] [job_id]`<br><b>Cancel a job of a specific server in a specific port</b>`lprm -h [server]:[port] [job_id]`<br><b>Cancel multiple jobs with a encrypted connection to the server</b>`lprm -E [job_id1 job_id2 ...]`<br><b>Cancel all jobs</b>`lprm -`<br><b>Cancel the current job of a specific printer or class</b>`lprm -P [destination]/[instance]`


title: TLDR
content:
<b>Set the default printer</b>`lpadmin -d [printer]`<br><b>Delete a specific printer or class</b>`lpadmin -x [printer|class]`<br><b>Add a printer to a class</b>`lpadmin -p [printer] -c [class]`<br><b>Remove a printer from a class</b>`lpadmin -p [printer] -r [class]`


title: TLDR
content:
<b>Start in chat mode</b>`chatgpt`<br><b>Give a prompt to answer to</b>`chatgpt [[-p|--prompt]] "[What is the regex to match an email address?]"`<br><b>Start in chat mode using a specific model (default is gpt-3.5-turbo)</b>`chatgpt [[-m|--model]] [gpt-4]`<br><b>Start in chat mode with an initial prompt</b>`chatgpt [[-i|--init-prompt]] "[You are Rick, from Rick and Morty. Respond to questions using his mannerism and include insulting jokes.]"`<br><b>Pipe the result of a command to chatgpt as a prompt</b>`echo "[How to view running processes on Ubuntu?]" | chatgpt`<br><b>Generate an image using DALL-E</b>`chatgpt [[-p|--prompt]] "[image: A white cat]"`


title: TLDR
content:
<b>Flip the current (non-persistent) values of the specified booleans</b>`sudo togglesebool [virt_use_samba|virt_use_usb|...]`<br><b>Flip multiple booleans</b>`sudo togglesebool [key1 key2 ...]`


title: TLDR
content:
<b>Show all EXIF data</b>`jhead [path/to/image.jpg]`<br><b>Set the file's date and time to the EXIF create date (file creation date will be changed)</b>`jhead -ft [path/to/image.jpg]`<br><b>Set the EXIF time to the file's date and time (EXIF data will be changed)</b>`jhead -dsft [path/to/image.jpg]`<br><b>Rename all JPEG files based on the EXIF create date to YYYY_MM_DD-HH_MM_SS.jpg</b>`jhead -n%Y_%m_%d-%H_%M_%S *.jpg`<br><b>Rotate losslessly all JPEG images by 90, 180 or 270 based on the EXIF orientation tag</b>`jhead -autorot *.jpg`<br><b>Update all EXIF timestamps (Format: +- hour:minute:seconds) (example: forgot to change the camera's time zone - removing 1 hour from timestamps)</b>`jhead -ta-1:00:00 *.jpg`<br><b>Remove all EXIF data (including thumbnails)</b>`jhead -purejpg [path/to/image.jpg]`


title: TLDR
content:
<b>Connect to the Tor network</b>`tor`<br><b>View Tor configuration</b>`tor --config`<br><b>Check Tor status</b>`tor --status`<br><b>Run as client only</b>`tor --client`<br><b>Run as relay</b>`tor --relay`<br><b>Run as bridge</b>`tor --bridge`<br><b>Run as a hidden service</b>`tor --hidden-service`


title: TLDR
content:
<b>Redirect the IO streams (stdout, stderr, and stdin) of a Slurm job step to the current terminal</b>`sattach [jobid].[stepid]`<br><b>Use the current console's input as stdin to the specified task</b>`sattach --input-filter [task_number]`<br><b>Only redirect stdin/stderr of the specified task</b>`sattach --[output|error]-filter [task_number]`


title: TLDR
content:
<b>Listen for idle activity using the configuration in $XDG_CONFIG_HOME/swayidle/config or $HOME/swayidle/config</b>`swayidle`<br><b>Specify an alternative path to the configuration file</b>`swayidle -C [path/to/file]`


title: TLDR
content:
<b>Browse through all available cheatsheets</b>`navi`<br><b>Browse the cheatsheet for navi itself</b>`navi fn welcome`<br><b>Print a command from the cheatsheet without executing it</b>`navi --print`<br><b>Output shell widget source code (It automatically detects your shell if possible, but can also be specified manually)</b>`navi widget [shell]`<br><b>Autoselect and execute the snippet that best matches a query</b>`navi --query '[query]' --best-match`


title: TLDR
content:
<b>Update the operating system</b>`steamos-update`<br><b>Check if there is an update available</b>`steamos-update check`


title: TLDR
content:
<b>Show the current setting of [a]ll booleans</b>`getsebool -a`<br><b>Set or unset a boolean temporarily (non-persistent across reboot)</b>`sudo setsebool [httpd_can_network_connect] [1|true|on|0|false|off]`<br><b>Set or unset a boolean [P]ersistently</b>`sudo setsebool -P [container_use_devices] [1|true|on|0|false|off]`<br><b>Set or unset multiple booleans at once [P]ersistently</b>`sudo setsebool -P [key1 1 key2 0 ...]`<br><b>Set or unset a boolean persistently (alternative method using semanage-boolean)</b>`sudo semanage boolean [[-m|--modify]] [-1|--on|-0|--off] [haproxy_connect_any]`


title: TLDR
content:
<b>Get a standard overview of your usual disks</b>`dysk`<br><b>Sort by free size</b>`dysk [[-s|--sort]] free`<br><b>Include only HDD disks</b>`dysk [[-f|--filter]] 'disk = HDD'`<br><b>Exclude SSD disks</b>`dysk [[-f|--filter]] 'disk <> SSD'`<br><b>Display disks with high utilization or low free space</b>`dysk [[-f|--filter]] 'use > 65% | free < 50G'`


title: TLDR
content:
<b>Convert an image to JPEG XL</b>`cjxl [path/to/image.ext] [path/to/output.jxl]`<br><b>Set quality to lossless and maximize compression of the resulting image</b>`cjxl --distance 0 --effort 9 [path/to/image.ext] [path/to/output.jxl]`<br><b>Display an extremely detailed help page</b>`cjxl [[-h -v -v -v -v|--help --verbose --verbose --verbose --verbose]]`


title: TLDR
content:
<b>Compile a source file into a libtool object</b>`libtool [[c|compile]] gcc [[-c|--compile]] [path/to/source.c] [[-o|--output]] [path/to/source.lo]`<br><b>Create a library or an executable</b>`libtool [[l|link]] gcc [[-o|--output]] [path/to/library.lo] [path/to/source.lo]`<br><b>Automatically set the library path so that another program can use uninstalled libtool generated programs or libraries</b>`libtool [[e|execute]] gdb [path/to/program]`<br><b>Install a shared library</b>`libtool [[i|install]] cp [path/to/library.la] [path/to/installation_directory]`<br><b>Complete the installation of libtool libraries on the system</b>`libtool [[f|finish]] [path/to/installation_directory]`<br><b>Delete installed libraries or executables</b>`libtool [[u|uninstall]] [path/to/installed_library.la]`<br><b>Delete uninstalled libraries or executables</b>`libtool [[cl|clean]] rm [path/to/source.lo] [path/to/library.la]`


title: TLDR
content:
<b>List available locales</b>`eselect locale list`<br><b>Set the LANG environment variable in /etc/profile.env by name or index from the list command</b>`eselect locale set [name|index]`<br><b>Display the value of LANG in /etc/profile.env</b>`eselect locale show`


title: TLDR
content:
<b>List all port labeling rules</b>`sudo semanage port [[-l|--list]]`<br><b>List all user-defined port labeling rules without headings</b>`sudo semanage port [[-l|--list]] [[-C|--locallist]] [[-n|--noheading]]`<br><b>Add a user-defined rule that assigns a label to a protocol-port pair</b>`sudo semanage port [[-a|--add]] [[-t|--type]] [ssh_port_t] [[-p|--proto]] [tcp] [22000]`<br><b>Add a user-defined rule that assigns a label to a protocol-port-range pair</b>`sudo semanage port [[-a|--add]] [[-t|--type]] [http_port_t] [[-p|--proto]] [tcp] [80-88]`<br><b>Delete a user-defined rule using its protocol-port pair</b>`sudo semanage port [[-d|--delete]] [[-p|--proto]] [udp] [11940]`


title: TLDR
content:
<b>Reboot the system</b>`systemctl reboot`<br><b>Reboot into the BIOS/UEFI menu</b>`systemctl reboot --firmware-setup`


title: TLDR
content:
<b>Set the filesystem to be mutable</b>`sudo steamos-readonly disable`<br><b>Set the filesystem to be read only</b>`sudo steamos-readonly enable`


title: TLDR
content:
<b>Match the sender address using a case-insensitive search</b>`exiqgrep -f '<[email@example.com]>'`<br><b>Match the sender address and display message IDs only</b>`exiqgrep -i -f '<[email@example.com]>'`<br><b>Match the [r]ecipient address</b>`exiqgrep -r '[email@example.com]'`<br><b>Remove all messages matching the sender address from the queue</b>`exiqgrep -i -f '<[email@example.com]>' | xargs exim -Mrm`<br><b>Test for bounced messages</b>`exiqgrep -f '^<>$'`<br><b>Display the [c]ount of bounced messages</b>`exiqgrep -c -f '^<>$'`


title: TLDR
content:
<b>Start an interactive shell session on a node in the cluster</b>`salloc`<br><b>Execute the specified command synchronously on a node in the cluster</b>`salloc [ls --all]`<br><b>Only allocate nodes fulfilling the specified constraints</b>`salloc [[-C|--constraint]] [(amd|intel)&gpu]`


title: TLDR
content:
<b>Display all extractable information contained in the ELF file</b>`eu-readelf [[-a|--all]] [path/to/file]`<br><b>Display the contents of all NOTE segments/sections, or of a particular segment/section</b>`eu-readelf [[-n|--notes]] [.note.ABI-tag] [path/to/file]`


title: TLDR
content:
<b>Move specific files to the trash bin</b>`gio trash [path/to/file_or_directory1 path/to/file_or_directory2 ...]`<br><b>List trash bin items</b>`gio trash --list`<br><b>Restore a specific item from trash using its ID</b>`gio trash trash://[id]`


title: TLDR
content:
<b>List all attributes of devices of a bus (eg. pci, usb). View all buses using ls /sys/bus</b>`systool -b [bus] -v`<br><b>List all attributes of a class of devices (eg. drm, block). View all classes using ls /sys/class</b>`systool -c [class] -v`<br><b>Show only device drivers of a bus (eg. pci, usb)</b>`systool -b [bus] -D`


title: TLDR
content:
<b>Pull the list of SlackBuilds to run sport for the first time</b>`sudo mkdir [[-p|--parents]] /usr/ports && sudo rsync [[-av|--archive --verbose]] rsync://slackbuilds.org /slackbuilds/$(awk '{print $2}' /etc/slackware-version)/ /usr/ports/`<br><b>Pull in any updates to the system's tree via rsync</b>`sudo sport rsync`<br><b>Search for a package by name</b>`sport search "[keyword]"`<br><b>Check if a package is installed</b>`sport check [package]`<br><b>Display README and .info files of a package</b>`sport cat [package]`<br><b>Install a package once the dependencies are resolved</b>`sudo sport install [package]`<br><b>Install a list of packages from a file (format: packages separated by spaces)</b>`sudo sport install $(< [path/to/list])`


title: TLDR
content:
<b>Generate a new random identifier</b>`systemd-id128 new`<br><b>Print the identifier of the current machine</b>`systemd-id128 machine-id`<br><b>Print the identifier of the current boot</b>`systemd-id128 boot-id`<br><b>Print the identifier of the current service invocation (this is available in systemd services)</b>`systemd-id128 invocation-id`<br><b>Generate a new random identifier and print it as a UUID (five groups of digits separated by hyphens)</b>`systemd-id128 new [[-u|--uuid]]`


title: TLDR
content:
<b>Initialize kde-builder</b>`kde-builder --initial-setup`<br><b>Compile a KDE component and its dependencies from the source (use workspace to compile Plasma desktop)</b>`kde-builder [component_name1 component_name2 ...]`<br><b>Compile a component without updating its local code and without compiling its dependencies</b>`kde-builder [[-SD|--no-src --no-include-dependencies]] [component_name]`<br><b>Refresh the build directories before compiling</b>`kde-builder [[-r|--refresh-build]] [component_name]`<br><b>Resume compilation from a specific dependency</b>`kde-builder [[-f|--resume-from]] [dependency_component] [component_name]`<br><b>Run a component with a specified executable name</b>`kde-builder --run [executable_name]`<br><b>Install login session</b>`kde-builder --install-login-session-only`<br><b>Use system libraries in place of a component if it fails to build</b>`kde-builder --no-stop-on-failure [component_name]`


title: TLDR
content:
<b>Add kernel boot arguments to all kernel menu entries</b>`sudo grubby --update-kernel=ALL --args '[quiet console=ttyS0]'`<br><b>Remove existing arguments from the entry for the default kernel</b>`sudo grubby --update-kernel=DEFAULT --remove-args [quiet]`<br><b>List all kernel menu entries</b>`sudo grubby --info=ALL`


title: TLDR
content:
<b>Display a list of installed modules</b>`eselect`<br><b>View documentation for a specific module</b>`tldr eselect [module]`<br><b>Display a help message for a specific module</b>`eselect [module] help`


title: TLDR
content:
<b>Add a plugin</b>`hyprpm add [git_url]`<br><b>Remove a plugin</b>`hyprpm remove [git_url|plugin_name]`<br><b>Enable a plugin</b>`hyprpm enable [plugin_name]`<br><b>Disable a plugin</b>`hyprpm disable [plugin_name]`<br><b>Update and check all plugins</b>`hyprpm update`<br><b>Force an operation</b>`hyprpm [[-f|--force]] [operation]`<br><b>List all installed plugins</b>`hyprpm list`


title: TLDR
content:
<b>Perform reconnaissance on target host(s) (detailed scan results will be dumped in ./results)</b>`sudo autorecon [host_or_ip1,host_or_ip2,...]`<br><b>Perform reconnaissance on target(s) from a file</b>`sudo autorecon [[-t|--target-file]] [path/to/file]`<br><b>Output results to a different directory</b>`sudo autorecon [[-o|--output]] [path/to/results] [host_or_ip1,host_or_ip2,...]`<br><b>Limit scanning to specific ports and protocols (T for TCP, U for UDP, B for both)</b>`sudo autorecon [[-p|--ports]] [T:21-25,80,443,U:53,B:123] [host_or_ip1,host_or_ip2,...]`


title: TLDR
content:
<b>Perform calculations according to an input file (.mop, .dat, and .arc)</b>`mopac [path/to/input_file]`<br><b>Minimal working example with HF that writes to the current directory and streams the output file</b>`touch test.out; echo "PM7\n#comment\n\nH 0.95506 0.05781 -0.03133\nF 1.89426 0.05781 -0.03133" > test.mop; mopac test.mop & tail [[-f|--follow]] test.out`


title: TLDR
content:
<b>Lookup the persistent security context setting of an absolute path</b>`matchpathcon /[path/to/file]`<br><b>Restrict lookup to settings on a specific file type</b>`matchpathcon -m [file|dir|pipe|chr_file|blk_file|lnk_file|sock_file] /[path/to/file]`<br><b>[V]erify that the persistent and current security context of a path agree</b>`matchpathcon -V /[path/to/file]`


title: TLDR
content:
<b>List non-free and contrib packages (and their description)</b>`check-dfsg-status`<br><b>Only output the package names</b>`check-dfsg-status [[-s|--sparse]]`


title: TLDR
content:
<b>Display the [s]tatus of the audit system</b>`sudo auditctl -s`<br><b>[l]ist all currently loaded audit rules</b>`sudo auditctl -l`<br><b>[D]elete all audit rules</b>`sudo auditctl -D`<br><b>[e]nable/disable the audit system</b>`sudo auditctl -e [1|0]`<br><b>Watch a file for changes</b>`sudo auditctl -a always,exit -F arch=b64 -F path=/[path/to/file] -F perm=wa`<br><b>Recursively watch a directory for changes</b>`sudo auditctl -a always,exit -F arch=b64 -F dir=/[path/to/directory]/ -F perm=wa`<br><b>Display [h]elp</b>`auditctl -h`


title: TLDR
content:
<b>Put SELinux in enforcing mode</b>`setenforce [1|Enforcing]`<br><b>Put SELiunx in permissive mode</b>`setenforce [0|Permissive]`


title: TLDR
content:
<b>Capture a photo with different encoding</b>`rpicam-still [[-e|--encoding]] [bmp|png|rgb|yuv420] [[-o|--output]] [path/to/file.[bmp|png|rgb|yuv420]]`<br><b>Capture a raw image</b>`rpicam-still [[-r|--raw]] [[-o|--output]] [path/to/file.jpg]`<br><b>Capture a 100 second exposure image</b>`rpicam-still [[-o|--output]] [path/to/file.jpg] --shutter 100000`


title: TLDR
content:
<b>View documentation for the libuser tool</b>`tldr lid.libuser`<br><b>View documentation for the idutils tool</b>`tldr lid.idutils`


title: TLDR
content:
<b>Set the wallpaper to an image</b>`swaybg [[-i|--image]] [path/to/image]`<br><b>Set the wallpaper mode</b>`swaybg [[-i|--image]] [path/to/image] [[-m|--mode]] [stretch|fit|fill|center|tile|solid_color]`<br><b>Set the wallpaper to a static color</b>`swaybg [[-c|--color]] "[#rrggbb]"`


title: TLDR
content:
<b>Show metadata in default name</b>`pw-metadata`<br><b>Show metadata with ID 0 in settings</b>`pw-metadata [[-n|--name]] [settings] [0]`<br><b>List all available metadata objects</b>`pw-metadata [[-l|--list]]`<br><b>Keep running and log the changes to the metadata</b>`pw-metadata [[-m|--monitor]]`<br><b>Delete all metadata</b>`pw-metadata [[-d|--delete]]`<br><b>Set log.level to 1 in settings</b>`pw-metadata [[-n|--name]] [settings] [0] [log.level] [1]`<br><b>Display help</b>`pw-metadata [[-h|--help]]`


title: TLDR
content:
<b>Merge HDF5 files produced on each allocated node for the specified job or step</b>`sh5util [[-j|--jobs]] [job_id|job_id.step_id]`<br><b>Extract one or more data series from a merged job file</b>`sh5util [[-j|--jobs]] [job_id|job_id.step_id] [[-E|--extract]] [[-i|--input]] [path/to/file.h5] [[-s|--series]] [Energy|Filesystem|Network|Task]`<br><b>Extract one data item from all nodes in a merged job file</b>`sh5util [[-j|--jobs]] [job_id|job_id.step_id] [[-I|--item-extract]] [[-s|--series]] [Energy|Filesystem|Network|Task] [[-d|--data]] [data_item]`


title: TLDR
content:
<b>Create an F2FS filesystem inside partition Y on device X</b>`sudo mkfs.f2fs [/dev/sdXY]`<br><b>Create an F2FS filesystem with a volume label</b>`sudo mkfs.f2fs -l [volume_label] [/dev/sdXY]`


title: TLDR
content:
<b>Start an interactive server setup</b>`[path/to/TerrariaServer]`<br><b>Start a Terraria server</b>`[path/to/TerrariaServer] -world [path/to/world.wld]`


title: TLDR
content:
<b>Uninstall a package</b>`sudo urpme [package]`<br><b>Uninstall orphan packages (Note: Use it with caution as it might unintentionally remove important packages)</b>`sudo urpme --auto-orphans`<br><b>Uninstall a package and its dependencies</b>`sudo urpme --auto-orphans [package]`


title: TLDR
content:
<b>List all configuration files that will be used</b>`pw-config`<br><b>List all configuration files that will be used by the PipeWire PulseAudio server</b>`pw-config [[-n|--name]] pipewire-pulse.conf`<br><b>List all configuration sections used by the PipeWire PulseAudio server</b>`pw-config [[-n|--name]] pipewire-pulse.conf list`<br><b>List the context.properties fragments used by the JACK clients</b>`pw-config [[-n|--name]] jack.conf list context.properties`<br><b>List the merged context.properties used by the JACK clients</b>`pw-config [[-n|--name]] jack.conf merge context.properties`<br><b>List the merged context.modules used by the PipeWire server and reformat</b>`pw-config [[-n|--name]] pipewire.conf [[-r|--recurse]] merge context.modules`<br><b>Display help</b>`pw-config [[-h|--help]]`


title: TLDR
content:
<b>Install a new crontab from the specified file</b>`scrontab [path/to/file]`<br><b>[e]dit the crontab of the current user</b>`scrontab -e`<br><b>[e]dit the crontab of the specified user</b>`scrontab --user=[user_id] -e`<br><b>[r]emove the current crontab</b>`scrontab -r`<br><b>Print the crontab of the current user to stdout</b>`scrontab -l`


title: TLDR
content:
<b>Decompress a JPEG XL image to another format</b>`djxl [path/to/image.jxl] [path/to/output.ext]`<br><b>Display an extremely detailed help page</b>`djxl [[-h -v -v -v -v|--help --verbose --verbose --verbose --verbose]]`


title: TLDR
content:
<b>Upgrade installed packages to the newest available versions</b>`sudo dnf5 upgrade`<br><b>Search packages via keywords</b>`dnf5 search [keyword1 keyword2 ...]`<br><b>Display details about a package</b>`dnf5 info [package]`<br><b>Install new packages (Note: Use -y to confirm all prompts automatically)</b>`sudo dnf5 install [package1 package2 ...]`<br><b>Remove packages</b>`sudo dnf5 remove [package1 package2 ...]`<br><b>List installed packages</b>`dnf5 list --installed`<br><b>Find which packages provide a given command</b>`dnf5 provides [command]`<br><b>Remove or expire cached data</b>`sudo dnf5 clean all`


title: TLDR
content:
<b>Print a JSON representation of the default PipeWire instance's current state</b>`pw-dump`<br><b>Print a JSON representation of an object</b>`pw-dump [object_id]`<br><b>Dump the current state monitoring changes, printing it again</b>`pw-dump [[-m|--monitor]]`<br><b>Dump the current state of a remote instance to a file</b>`pw-dump [[-r|--remote]] [remote_name] > [path/to/dump_file.json]`<br><b>Set a color configuration</b>`pw-dump [[-C|--color]] [never|always|auto]`<br><b>Display help</b>`pw-dump [[-h|--help]]`


title: TLDR
content:
<b>Convert the given assembly code to bytes</b>`pwn asm "[xor edi, edi]"`<br><b>Create a cyclic pattern of the specific number of characters</b>`pwn cyclic [number]`<br><b>Encode the given data into the hexadecimal system</b>`pwn hex [deafbeef]`<br><b>Decode the given data from hexadecimal</b>`pwn unhex [6c4f7645]`<br><b>Print a x64 Linux shellcode for running a shell</b>`pwn shellcraft [amd64.linux.sh]`<br><b>Check the binary security settings for the given ELF file</b>`pwn checksec [path/to/file]`<br><b>Check for Pwntools updates</b>`pwn update`<br><b>Display version</b>`pwn version`


title: TLDR
content:
<b>Display a camera preview stream for a specific amount of time (in milliseconds)</b>`rpicam-hello [[-t|--timeout]] [time]`<br><b>Tune the configuration for a particular camera sensor</b>`rpicam-hello --tuning-file [/usr/share/libcamera/ipa/rpi/path/to/config.json]`


title: TLDR
content:
<b>Index the reference genome</b>`bwa index [path/to/reference.fa]`<br><b>Map single-end reads (sequences) to indexed genome using 32 [t]hreads and compress the result to save space</b>`bwa mem -t 32 [path/to/reference.fa] [path/to/read_single_end.fq.gz] | gzip > [path/to/alignment_single_end.sam.gz]`<br><b>Map pair-end reads (sequences) to the indexed genome using 32 [t]hreads and compress the result to save space</b>`bwa mem -t 32 [path/to/reference.fa] [path/to/read_pair_end_1.fq.gz] [path/to/read_pair_end_2.fq.gz] | gzip > [path/to/alignment_pair_end.sam.gz]`<br><b>Map pair-end reads (sequences) to the indexed genome using 32 [t]hreads with [M]arking shorter split hits as secondary for output SAM file compatibility in Picard software and compress the result</b>`bwa mem -M -t 32 [path/to/reference.fa] [path/to/read_pair_end_1.fq.gz] [path/to/read_pair_end_2.fq.gz] | gzip > [path/to/alignment_pair_end.sam.gz]`<br><b>Map pair-end reads (sequences) to indexed genome using 32 [t]hreads with FASTA/Q [C]omments (e.g. BC:Z:CGTAC) appending to a compressed result</b>`bwa mem -C -t 32 [path/to/reference.fa] [path/to/read_pair_end_1.fq.gz] [path/to/read_pair_end_2.fq.gz] | gzip > [path/to/alignment_pair_end.sam.gz]`


title: TLDR
content:
<b>Create an EROFS filesystem based on the root directory</b>`mkfs.erofs image.erofs root/`<br><b>Create an EROFS image with a specific UUID</b>`mkfs.erofs -U [UUID] image.erofs root/`<br><b>Create a compressed EROFS image</b>`mkfs.erofs -zlz4hc image.erofs root/`<br><b>Create an EROFS image where all files are owned by root</b>`mkfs.erofs --all-root image.erofs root/`


title: TLDR
content:
<b>List Slurm share information</b>`sshare`<br><b>Control the output format</b>`sshare --[parsable|parsable2|json|yaml]`<br><b>Control the fields to display</b>`sshare [[-o|--format]] [format_string]`<br><b>Display information for the specified users only</b>`sshare [[-u|--users]] [user_id_1,user_id_2,...]`


title: TLDR
content:
<b>List all booleans settings</b>`sudo semanage boolean [[-l|--list]]`<br><b>List all user-defined boolean settings without headings</b>`sudo semanage boolean [[-l|--list]] [[-C|--locallist]] [[-n|--noheading]]`<br><b>Set or unset a boolean persistently</b>`sudo semanage boolean [[-m|--modify]] [-1|--on|-0|--off] [haproxy_connect_any]`


title: TLDR
content:
<b>Show the current setting of a boolean</b>`getsebool [httpd_can_connect_ftp]`<br><b>Show the current setting of [a]ll booleans</b>`getsebool -a`<br><b>Show the current setting of all booleans with explanations</b>`sudo semanage boolean [[-l|--list]]`


title: TLDR
content:
<b>Connect stdin to a port (relative to /dev) and optionally specify a baud rate (defaults to 9600)</b>`agetty [tty] [115200]`<br><b>Assume stdin is already connected to a tty and set a timeout for the login</b>`agetty [[-t|--timeout]] [timeout_in_seconds] -`<br><b>Assume the tty is 8-bit, overriding the TERM environment variable set by init</b>`agetty [[-8|--8bits]] - [term_var]`<br><b>Skip the login (no login) and invoke, as root, another login program instead of /bin/login</b>`agetty [[-n|--skip-login]] [[-l|--login-program]] [login_program] [tty]`<br><b>Do not display the pre-login (issue) file (/etc/issue by default) before writing the login prompt</b>`agetty [[-i|--noissue]] -`<br><b>Change the root directory and write a specific fake host into the utmp file</b>`agetty [[-r|--chroot]] /[path/to/root_directory] [[-H|--host]] [fake_host] -`


title: TLDR
content:
<b>Run an installed application</b>`flatpak run [com.example.app]`<br><b>Run an installed application from a specific branch e.g. stable, beta, master</b>`flatpak run --branch=[stable|beta|master|...] [com.example.app]`<br><b>Run an interactive shell inside a flatpak</b>`flatpak run --command=[sh] [com.example.app]`<br><b>Run an installed application with a specific runtime version</b>`flatpak run --runtime-version=[24.08|master|stable|...] [com.example.app]`<br><b>Run an installed application with a different runtime (but same version number)</b>`flatpak run --runtime=[org.freedesktop.Sdk] [com.example.app]`


title: TLDR
content:
<b>Run a graphical program remotely and display it locally</b>`waypipe ssh [user]@[server] [program]`<br><b>Open an SSH tunnel to run any program remotely and display it locally</b>`waypipe ssh [user]@[server]`<br><b>Skip testing for Vulkan support</b>`waypipe --test-skip-vulkan ssh [user]@[server] [program]`<br><b>Display help</b>`waypipe [[-h|--help]]`


title: TLDR
content:
<b>Display an interactive view of PipeWire nodes and devices</b>`pw-top`<br><b>Monitor a remote instance</b>`pw-top [[-r|--remote]] [remote_name]`<br><b>Print information periodically instead of running in interactive mode</b>`pw-top [[-b|--batch-mode]]`<br><b>Print information periodically for a specific number of times</b>`pw-top [[-b|--batch-mode]] [[-n|--iterations]] [3]`


title: TLDR
content:
<b>Create a virtual monitor</b>`krfb-virtualmonitor --resolution [1920]x[1080] --name [monitor_name] --password [password] --port [5900]`


title: TLDR
content:
<b>Capture a 10 second video</b>`rpicam-vid [[-t|--timeout]] 10000 [[-o|--output]] [path/to/file.h264]`


title: TLDR
content:
<b>Extract file contents in the current directory</b>`ripmime -i [path/to/file]`<br><b>Extract file contents in a specific directory</b>`ripmime -i [path/to/file] -d [path/to/directory]`<br><b>Extract file contents and print verbose output</b>`ripmime -i [path/to/file] -v`<br><b>Get detailed information about the whole decoding process</b>`ripmime -i [path/to/file] --debug`


title: TLDR
content:
<b>Show information about all active IPC facilities</b>`lsipc`<br><b>Show information about active shared [m]emory segments, message [q]ueues or [s]empahore sets</b>`lsipc [--shmems|--queues|--semaphores]`<br><b>Show full details on the resource with a specific ID</b>`lsipc [--shmems|--queues|--semaphores] [[-i|--id]] [resource_id]`<br><b>Print the given output columns (see all supported columns with --help)</b>`lsipc [[-o|--output]] [KEY,ID,PERMS,SEND,STATUS,NSEMS,RESOURCE,...]`<br><b>Use [r]aw, [J]SON, [l]ist or [e]xport (key="value") format</b>`lsipc [--raw|--json|--list|--export]`<br><b>Don't truncate the output</b>`lsipc --notruncate`


title: TLDR
content:
<b>Show all performance counters related to the execution of slurmctld</b>`sdiag [[-a|--all]]`<br><b>Reset performance counters related to the execution of slurmctld</b>`sdiag [[-r|--reset]]`<br><b>Specify the output format</b>`sdiag [[-a|--all]] --[json|yaml]`<br><b>Specify the cluster to send commands to</b>`sdiag [[-a|--all]] [[-M|--cluster]] [cluster_name]`


title: TLDR
content:
<b>Start the daemon</b>`sudo ntpd`<br><b>Synchronize system time with remote servers a single time (quit after synchronizing)</b>`sudo ntpd --quit`<br><b>Synchronize a single time allowing "Big" adjustments</b>`sudo ntpd --panicgate --quit`


title: TLDR
content:
<b>Update all enabled media</b>`urpmi.update -a`<br><b>Update specific media (including disabled media)</b>`urpmi.update [medium1 medium2 ...]`<br><b>Update all media that contain a specific keyword</b>`urpmi.update [keyword]`<br><b>Update all configured media</b>`urpmi.update e`


title: TLDR
content:
<b>Display statistics every 5 seconds</b>`sudo turbostat`<br><b>Display statistics every specified amount of seconds</b>`sudo turbostat [[-i|--interval]] [n_seconds]`<br><b>Do not decode and print the system configuration header information</b>`sudo turbostat --quiet`<br><b>Display useful information about CPU every 1 second, without header information</b>`sudo turbostat --quiet [[-i|--interval]] 1 --cpu 0-[CPU_thread_count] --show "PkgWatt","Busy%","Core","CoreTmp","Thermal"`<br><b>Display help</b>`turbostat --help`


title: TLDR
content:
<b>Read a text file at a specific speed</b>`cat [path/to/file.txt] | speedread -wpm [250]`<br><b>Resume from a specific line</b>`cat [path/to/file.txt] | speedread -resume [5]`<br><b>Show multiple words at a time</b>`cat [path/to/file.txt] | speedread -multiword`<br><b>Slow down by 10% during the reading session</b>`<[>`<br><b>Speed up by 10% during the reading session</b>`<]>`<br><b>Pause, and show the last few lines as context</b>`<Space>`


title: TLDR
content:
<b>Create and run a virtual machine from a configuration file</b>`quickemu --vm [path/to/file.conf]`<br><b>Do not commit any changes to disk/snapshot but write any changes to temporary files</b>`quickemu --status-quo --vm [path/to/file.conf]`<br><b>Start the virtual machine in full-screen mode (<Ctrl Alt f> to exit) and select the display backend (sdl by default)</b>`quickemu --fullscreen --display [sdl|gtk|spice|spice-app|none] --vm [path/to/file.conf]`<br><b>Select a virtual audio device to emulate and create a desktop shortcut</b>`quickemu --sound-card [intel-hda|ac97|es1370|sb16|none] --shortcut --vm [path/to/file.conf]`<br><b>Create a snapshot</b>`quickemu --snapshot create [tag] --vm [path/to/file.conf]`<br><b>Restore a snapshot</b>`quickemu --snapshot apply [tag] --vm [path/to/file.conf]`<br><b>Delete a snapshot</b>`quickemu --snapshot delete [tag] --vm [path/to/file.conf]`


title: TLDR
content:
<b>List all detected input devices</b>`sudo evtest`<br><b>Display events from a specific input device</b>`sudo evtest /dev/input/event[number]`<br><b>Grab the device exclusively, preventing other clients from receiving events</b>`sudo evtest --grab /dev/input/event[number]`<br><b>Query the state of a specific key or button on an input device</b>`sudo evtest --query /dev/input/event[number] [event_type] [event_code]`


title: TLDR
content:
<b>Restart plasmashell</b>`systemctl restart --user plasma-plasmashell`<br><b>Restart plasmashell without systemd</b>`plasmashell --replace & disown`<br><b>Display help</b>`plasmashell [[-h|--help]]`<br><b>Display help, including Qt options</b>`plasmashell --help-all`


title: TLDR
content:
<b>Show the current secure boot status</b>`sbctl status`<br><b>Create custom secure boot keys (by default, everything is stored in /var/lib/sbctl)</b>`sbctl create-keys`<br><b>Enroll the custom secure boot keys and Microsoft's UEFI vendor certificates</b>`sbctl enroll-keys [[-m|--microsoft]]`<br><b>Automatically run create-keys and enroll-keys based on the settings in /etc/sbctl/sbctl.conf</b>`sbctl setup --setup`<br><b>Sign an EFI binary with the created key and save the file to the database</b>`sbctl sign [[-s|--save]] [path/to/efi_binary]`<br><b>Re-sign all the saved files</b>`sbctl sign-all`<br><b>Verify that all EFI executables on the EFI system partition have been signed</b>`sbctl verify`


title: TLDR
content:
<b>Capture a video for a specific amount of seconds</b>`rpicam-raw [[-t|--timeout]] [2000] [[-o|--output]] [path/to/file.raw]`<br><b>Change video dimensions and framerate</b>`rpicam-raw [[-t|--timeout]] [5000] --width [4056] --height [3040] [[-o|--output]] [path/to/file.raw] --framerate [8]`


title: TLDR
content:
<b>Produce an SVG and PNG graph</b>`pacgraph`<br><b>Produce an SVG graph</b>`pacgraph --svg`<br><b>Print summary to console</b>`pacgraph --console`<br><b>Override the default filename/location (Note: Do not specify the file extension)</b>`pacgraph --file=[path/to/file]`<br><b>Change the color of packages that are not dependencies</b>`pacgraph --top=[color]`<br><b>Change the color of package dependencies</b>`pacgraph --dep=[color]`<br><b>Change the background color of a graph</b>`pacgraph --background=[color]`<br><b>Change the color of links between packages</b>`pacgraph --link=[color]`


title: TLDR
content:
<b>Send a file to all nodes allocated to the current job</b>`sbcast [path/to/file] [path/to/destination]`<br><b>Autodetect shared libraries the transmitted file depends upon and transmit them as well</b>`sbcast --send-libs=[yes] [path/to/executable] [path/to/destination]`


title: TLDR
content:
<b>Profile the default instance, logging to profile.log (gnuplot files and a HTML file for result visualizing are also generated)</b>`pw-profiler`<br><b>Change the log output file</b>`pw-profiler [[-o|--output]] [path/to/file.log]`<br><b>Profile a remote instance</b>`pw-profiler [[-r|--remote]] [remote_name]`<br><b>Display help</b>`pw-profiler [[-h|--help]]`


title: TLDR
content:
<b>List all process types (a.k.a domains) that are in permissive mode</b>`sudo semanage permissive [[-l|--list]]`<br><b>Set permissive mode for a domain</b>`sudo semanage permissive [[-a|--add]] [httpd_t]`<br><b>Unset permissive mode for a domain</b>`sudo semanage permissive [[-d|--delete]] [httpd_t]`


title: TLDR
content:
<b>Run a program using a dedicated Nvidia GPU</b>`prime-run [command]`<br><b>Validate whether the Nvidia card is being used</b>`prime-run glxinfo | grep "OpenGL renderer"`


title: TLDR
content:
<b>Display the list of all supported guest operating systems, versions and variants</b>`quickget list`<br><b>Download and create the virtual machine configuration for building a Quickemu virtual machine for an OS</b>`quickget [os] [release] [edition]`<br><b>Download configuration for a Windows 11 VM with VirtIO drivers for Windows</b>`quickget windows 11`<br><b>Download a macOS recovery image and creates a virtual machine configuration</b>`quickget macos [mojave|catalina|big-sur|monterey|ventura|sonoma]`<br><b>Show an ISO URL for an operating system</b>`quickget --url fedora [release] [edition]`<br><b>Test if an ISO file is available for an operating system</b>`quickget --check nixos [release] [edition]`<br><b>Download an image without building any VM configuration</b>`quickget --download [os] [release] [edition]`<br><b>Create a VM configuration for an OS image</b>`quickget --create-config [os] [path/to/iso]`


title: TLDR
content:
<b>Initialize kdesrc-build</b>`kdesrc-build --initial-setup`<br><b>Compile a KDE component and its dependencies from source</b>`kdesrc-build [component_name]`<br><b>Compile a component without updating its local code and without compiling its dependencies</b>`kdesrc-build --no-src --no-include-dependencies [component_name]`<br><b>Refresh the build directories before compiling</b>`kdesrc-build --refresh-build [component_name]`<br><b>Resume compilation from a specific dependency</b>`kdesrc-build --resume-from [dependency_component] [component_name]`<br><b>Run a component with a specified executable name</b>`kdesrc-build --run --exec [executable_name] [component_name]`<br><b>Build all configured components</b>`kdesrc-build`<br><b>Use system libraries in place of a component if it fails to build</b>`kdesrc-build --no-stop-on-failure [component_name]`


title: TLDR
content:
<b>Record the screen and write the recording to a file (by default, byzanz-record will only record for 10 seconds)</b>`byzanz-record [path/to/file.[byzanz|flv|gif|ogg|ogv|webm]]`<br><b>Show information while and after recording</b>`byzanz-record [[-v|--verbose]] [path/to/file.[byzanz|flv|gif|ogg|ogv|webm]]`<br><b>Record the screen for a minute</b>`byzanz-record [[-d|--duration]] 60 [path/to/file.[byzanz|flv|gif|ogg|ogv|webm]]`<br><b>Delay recording for 10 seconds</b>`byzanz-record --delay 10 [path/to/file.[byzanz|flv|gif|ogg|ogv|webm]]`


title: TLDR
content:
<b>Count observed frequencies of words in a FASTA file, providing parameter values with interactive prompt</b>`compseq [path/to/file.fasta]`<br><b>Count observed frequencies of amino acid pairs from a FASTA file, save output to a text file</b>`compseq [path/to/input_protein.fasta] -word 2 [path/to/output_file.comp]`<br><b>Count observed frequencies of hexanucleotides from a FASTA file, save output to a text file and ignore zero counts</b>`compseq [path/to/input_dna.fasta] -word 6 [path/to/output_file.comp] -nozero`<br><b>Count observed frequencies of codons in a particular reading frame; ignoring any overlapping counts (i.e. move window across by word-length 3)</b>`compseq -sequence [path/to/input_rna.fasta] -word 3 [path/to/output_file.comp] -nozero -frame [1]`<br><b>Count observed frequencies of codons frame-shifted by 3 positions; ignoring any overlapping counts (should report all codons except the first one)</b>`compseq -sequence [path/to/input_rna.fasta] -word 3 [path/to/output_file.comp] -nozero -frame 3`<br><b>Count amino acid triplets in a FASTA file and compare to a previous run of compseq to calculate expected and normalised frequency values</b>`compseq -sequence [path/to/human_proteome.fasta] -word 3 [path/to/output_file1.comp] -nozero -infile [path/to/output_file2.comp]`<br><b>Approximate the above command without a previously prepared file, by calculating expected frequencies using the single base/residue frequencies in the supplied input sequence(s)</b>`compseq -sequence [path/to/human_proteome.fasta] -word 3 [path/to/output_file.comp] -nozero -calcfreq`<br><b>Display help (use -help -verbose for more information on associated and general qualifiers)</b>`compseq -help`


title: TLDR
content:
<b>Monitor the default PipeWire instance</b>`pw-mon`<br><b>Monitor a specific remote instance</b>`pw-mon [[-r|--remote]] [remote_name]`<br><b>Monitor the default instance specifying a color configuration</b>`pw-mon [[-N|--color]] [never|always|auto]`<br><b>Display help</b>`pw-mon [[-h|--help]]`


title: TLDR
content:
<b>View the factors determining the scheduling priority of all jobs</b>`sprio`<br><b>View the factors determining the specified job's scheduling priority</b>`sprio [[-j|--jobs]] [job_id_1,job_id_2,...]`<br><b>Output additional information</b>`sprio [[-l|--long]]`<br><b>View information for the jobs of specified users</b>`sprio [[-u|--user]] [user_name_1,user_name_2,...]`<br><b>Print the weights for each factor determining job scheduling priority</b>`sprio [[-w|--weights]]`


title: TLDR
content:
<b>Reload Hyprland configuration</b>`hyprctl reload`<br><b>Return the active window name</b>`hyprctl activewindow`<br><b>List all connected input devices</b>`hyprctl devices`<br><b>List all outputs with respective properties</b>`hyprctl workspaces`<br><b>Call a dispatcher</b>`hyprctl dispatch [dispatcher]`<br><b>Set a configuration keyword dynamically</b>`hyprctl keyword [keyword] [value]`<br><b>Display version</b>`hyprctl version`


title: TLDR
content:
<b>Select a region and print it to stdout</b>`slurp`<br><b>Select a region and print it to stdout, while displaying the dimensions of the selection</b>`slurp -d`<br><b>Select a single point instead of a region</b>`slurp -p`<br><b>Select an output and print its name</b>`slurp -o -f '%o'`<br><b>Select a specific region and take a borderless screenshot of it, using grim</b>`grim -g "$(slurp -w 0)"`<br><b>Select a specific region and take a borderless video of it, using wf-recorder</b>`wf-recorder [[-g|--geometry]] "$(slurp -w 0)"`


title: TLDR
content:
<b>Release all address leases</b>`sudo dhcpcd [[-k|--release]]`<br><b>Request the DHCP server for new leases</b>`sudo dhcpcd [[-n|--rebind]]`


title: TLDR
content:
<b>Search for packages that contain a file</b>`urpmf [filename]`<br><b>Search for packages that contain both a keyword [a]nd another in their summaries</b>`urpmf --summary [keyword1] -a [keyword2]`<br><b>Search for packages that contain a keyword [o]r another in their descriptions</b>`urpmf --description [keyword1] -o [keyword2]`<br><b>Search for packages that do not contain a keyword in their name ignoring case distinction using "|" as the [F]ield separator (":" by default)</b>`urpmf --description ! [keyword] -F'|'`


title: TLDR
content:
<b>Remove a medium</b>`sudo urpmi.removemedia [medium]`<br><b>Remove [a]ll media</b>`sudo urpmi.removemedia -a`<br><b>Remove media fuzz[y] matching on media names</b>`sudo urpmi.removemedia -y [keyword]`


title: TLDR
content:
<b>Generate a graph to pw.dot file</b>`pw-dot`<br><b>Read objects from pw-dump JSON file</b>`pw-dot [[-j|--json]] [path/to/file.json]`<br><b>Specify an output file, showing all object types</b>`pw-dot [[-o|--output]] [path/to/file.dot] [[-a|--all]]`<br><b>Print .dot graph to stdout, showing all object properties</b>`pw-dot [[-o|--output]] - [[-d|--detail]]`<br><b>Generate a graph from a remote instance, showing only linked objects</b>`pw-dot [[-r|--remote]] [remote_name] [[-s|--smart]]`<br><b>Lay the graph from left to right, instead of dot's default top to bottom</b>`pw-dot [[-L|--lr]]`<br><b>Lay the graph using 90-degree angles in edges</b>`pw-dot [[-9|--90]]`<br><b>Display help</b>`pw-dot [[-h|--help]]`


title: TLDR
content:
<b>Create a new save file</b>`[path/to/factorio] --create [path/to/save_file.zip]`<br><b>Start a Factorio server</b>`[path/to/factorio] --start-server [path/to/save_file.zip]`<br><b>Create a new save file with specific settings</b>`[path/to/factorio] --create [path/to/save.zip] --map-gen-settings [path/to/map-gen-settings.json] --map-settings [path/to/map-settings.json]`<br><b>Shut the server gracefully</b>`/quit`<br><b>Display help</b>`[path/to/factorio] [[-h|--help]]`


title: TLDR
content:
<b>Register a new trigger. Execute the specified program when the specified event occurs</b>`strigger --set --[primary_database_failure|primary_slurmdbd_failure|primary_slurmctld_acct_buffer_full|primary_slurmctld_failure|...] [[-p|--program]] [path/to/executable]`<br><b>Execute the specified program when the specified job terminated</b>`strigger --set [[-j|--jobid]] [job_id] [[-f|--fini]] [[-p|--program]] "[path/to/executable] [argument1 argument2 ...]"`<br><b>View active triggers</b>`strigger --get`<br><b>View active triggers regarding the specified job</b>`strigger --get [[-j|--jobid]] [job_id]`<br><b>Clear the specified trigger</b>`strigger --clear [trigger_id]`


title: TLDR
content:
<b>Get the security context of the current execution context</b>`secon`<br><b>Get the current security context of a process</b>`secon --pid [1]`<br><b>Get the current security context of a file, resolving all intermediate symlinks</b>`secon --file [path/to/file_or_directory]`<br><b>Get the current security context of a symlink itself (i.e. do not resolve)</b>`secon --link [path/to/symlink]`<br><b>Parse and explain a context specification</b>`secon [system_u:system_r:container_t:s0:c899,c900]`


title: TLDR
content:
<b>Start the PipeWire daemon</b>`pipewire`<br><b>Use a different configuration file</b>`pipewire --config [path/to/file.conf]`<br><b>Set the verbosity level (error, warn, info, debug or trace)</b>`pipewire -[v|vv|...|vvvvv]`<br><b>Display help</b>`pipewire --help`


title: TLDR
content:
<b>Display information about an installable package</b>`urpmq -i [package]`<br><b>Display direct dependencies of a package</b>`urpmq --requires [package]`<br><b>Display direct and indirect dependencies of a package</b>`urpmq [[-d|--requires-recursive]] [package]`<br><b>List the not installed packages needed for an RPM file with their sources</b>`sudo urpmq [[-d|--requires-recursive]] -m --sources [path/to/file.rpm]`<br><b>List all configured media with their URLs, including inactive media</b>`urpmq --list-media --list-url`<br><b>Search for a package printing [g]roup, version and [r]elease</b>`urpmq -g -r [[-y|--fuzzy]] [keyword]`<br><b>Search for a package with using its exact name</b>`urpmq -g -r [package]`


title: TLDR
content:
<b>Display the value of a Portage-specific environment variable</b>`portageq envvar [variable]`<br><b>Display a detailed list of repositories configured with Portage</b>`portageq repos_config /`<br><b>Display a list of repositories sorted by priority (highest first)</b>`portageq get_repos /`<br><b>Display a specific piece of metadata about an atom (i.e. package name including the version)</b>`portageq metadata / [ebuild|porttree|binary|...] [category]/[package] [BDEPEND|DEFINED_PHASES|DEPEND|...]`


title: TLDR
content:
<b>List leftover files and interactively choose what to do with each of them</b>`sudo rpmconf --all`<br><b>Delete orphaned RPMNEW and RPMSAVE files</b>`sudo rpmconf --all --clean`


title: TLDR
content:
<b>Install a package from the repository or from a local RPM file</b>`sudo urpmi [package|path/to/file.rpm]`<br><b>Download a package without installing it</b>`urpmi --no-install [package]`<br><b>Update all installed packages (run urpmi.update -a to get the available updates)</b>`sudo urpmi --auto-select`<br><b>Update a package of one or more machines on the network according to /etc/urpmi/parallel.cfg</b>`sudo urpmi --parallel local [package]`<br><b>Mark all orphaned packages as manually installed</b>`sudo urpmi $(urpmq --auto-orphans -f)`


title: TLDR
content:
<b>Capture an image and name the file</b>`rpicam-jpeg [[-o|--output]] [path/to/file.jpg]`<br><b>Capture an image with set dimensions</b>`rpicam-jpeg [[-o|--output]] [path/to/file.jpg] --width [1920] --height [1080]`<br><b>Capture an image with an exposure of 20 seconds and a gain of 150%</b>`rpicam-jpeg [[-o|--output]] [path/to/file.jpg] --shutter 20000 --gain 1.5`


title: TLDR
content:
<b>Find expanded results in all categories from the lake and sort them in the specified order</b>`wami [[-a|--show-all]] [[-S|--sort]] [asc|desc] [[-s|--search-all]] [search_string]`<br><b>Search GitHub to find expanded results, sorted in descending order</b>`wami [[-a|--show-all]] [[-S|--sort]] desc --github [search_string]`<br><b>Search GitHub for topics that match the search string</b>`wami --list-topics [search_string]`<br><b>Search the lake for a tool used in pentests to query for default credentials and sort the results in descending order</b>`wami [[-S|--sort]] desc [[-s|--search-all]] pentest credential default`


title: TLDR
content:
<b>Sleep until all processes whose PIDs have been specified have exited</b>`waitpid [pid1 pid2 ...]`<br><b>Sleep for at most n seconds</b>`waitpid [[-t|--timeout]] [n] [pid1 pid2 ...]`<br><b>Do not error if specified PIDs have already exited</b>`waitpid [[-e|--exited]] [pid1 pid2 ...]`<br><b>Sleep until n of the specified processes have exited</b>`waitpid [[-c|--count]] [n] [pid1 pid2 ...]`<br><b>Display help</b>`waitpid [[-h|--help]]`


title: TLDR
content:
<b>List all ebuild repositories registered on <https://repos.gentoo.org></b>`eselect repository list`<br><b>List enabled repositories</b>`eselect repository list -i`<br><b>Enable a repository from the list by its name or index from the list command</b>`eselect repository enable [name|index]`<br><b>Enable an unregistered repository</b>`eselect repository add [name] [rsync|git|mercurial|svn|...] [sync_uri]`<br><b>Disable repositories without removing their contents</b>`eselect repository disable [repo1 repo2 ...]`<br><b>Disable repositories and remove their contents</b>`eselect repository remove [repo1 repo2 ...]`<br><b>Create a local repository and enable it</b>`eselect repository create [name] [path/to/repo]`


title: TLDR
content:
<b>Recursively synchronize a directory to another location</b>`fpsync -v /[path/to/source]/ /[path/to/destination]/`<br><b>Recursively synchronize a directory with the final pass (It enables rsync's --delete option with each synchronization job)</b>`fpsync -v -E /[path/to/source]/ /[path/to/destination]/`<br><b>Recursively synchronize a directory to a destination using 8 concurrent synchronization jobs</b>`fpsync -v -n 8 -E /[path/to/source]/ /[path/to/destination]/`<br><b>Recursively synchronize a directory to a destination using 8 concurrent synchronization jobs spread over two remote workers (machine1 and machine2)</b>`fpsync -v -n 8 -E -w login@machine1 -w login@machine2 -d /[path/to/shared_directory] /[path/to/source]/ /[path/to/destination]/`<br><b>Recursively synchronize a directory to a destination using 4 local workers, each one transferring at most 1000 files and 100 MB per synchronization job</b>`fpsync -v -n 4 -f 1000 -s $((100 * 1024 * 1024)) /[path/to/source]/ /[path/to/destination]/`<br><b>Recursively synchronize any directories but exclude specific .snapshot* files (Note: Options and values must be separated by a pipe character)</b>`fpsync -v -O "-x|.snapshot*" /[path/to/source]/ /[path/to/destination]/`


title: TLDR
content:
<b>Change to desktop mode</b>`steamos-session-select plasma`<br><b>Change to gamemode (sets the system to boot into gamemode if -persistent options were selected previously)</b>`steamos-session-select`<br><b>Change to Wayland desktop mode</b>`steamos-session-select plasma-wayland`<br><b>Change to Wayland desktop mode and have the device boot to desktop</b>`steamos-session-select plasma-wayland-persistent`<br><b>Change to X11 desktop mode and have the device boot to desktop</b>`steamos-session-select plasma-x11-persistent`


title: TLDR
content:
<b>Add a medium</b>`sudo urpmi.addmedia [medium] [ftp://ftp.site.com/path/to/Mageia/RPMS]`<br><b>Add a medium from a hard drive (run genhdlist2 in the directory first)</b>`sudo urpmi.addmedia --distrib HD file://[path/to/repo]`<br><b>Add important media from a chosen mirror</b>`sudo urpmi.addmedia --distrib ftp://[mirror_website]/mirror/mageia/distrib/[version]/[arch]`<br><b>Automatically select mirrors from a mirror list</b>`sudo urpmi.addmedia --distrib --mirrorlist [mirrorlist]`


title: TLDR
content:
<b>Parse the specified UUIDs, use a tabular output format</b>`uuidparse [uuid1 uuid2 ...]`<br><b>Parse UUIDs from stdin</b>`[command] | uuidparse`<br><b>Use the JSON output format</b>`uuidparse [[-J|--json]] [uuid1 uuid2 ...]`<br><b>Do not print a header line</b>`uuidparse [[-n|--noheadings]] [uuid1 uuid2 ...]`<br><b>Use the raw output format</b>`uuidparse [[-r|--raw]] [uuid1 uuid2 ...]`<br><b>Specify which of the four output columns to print</b>`uuidparse [[-o|--output]] [UUID,VARIANT,TYPE,TIME]`<br><b>Display help</b>`uuidparse [[-h|--help]]`


title: TLDR
content:
<b>View documentation for listing enrolled fingerprints</b>`tldr fprintd-list`<br><b>View documentation for enrolling new fingerprints</b>`tldr fprintd-enroll`<br><b>View documentation for verifying a fingerprint against a database</b>`tldr fprintd-verify`<br><b>View documentation for deleting fingerprints from a database</b>`tldr fprintd-delete`


title: TLDR
content:
<b>Run a command as root</b>`run0 [command]`<br><b>Run a command as another user and/or group</b>`run0 [[-u|--user]] [username|uid] [[-g|--group]] [group_name|gid] [command]`


title: TLDR
content:
<b>Display the OOM-killer score of the process with a specific ID</b>`choom [[-p|--pid]] [pid]`<br><b>Change the adjust OOM-killer score of a specific process</b>`choom [[-p|--pid]] [pid] [[-n|--adjust]] [-1000..+1000]`<br><b>Run a command with a specific adjust OOM-killer score</b>`choom [[-n|--adjust]] [-1000..+1000] [command] [argument1 argument2 ...]`


title: TLDR
content:
<b>Run a command using Tor</b>`torsocks [command]`<br><b>Enable or disable Tor in this shell</b>`. torsocks [on|off]`<br><b>Spawn a new Tor enabled shell</b>`torsocks --shell`<br><b>Check if current shell is Tor enabled (LD_PRELOAD value will be empty if disabled)</b>`torsocks show`<br><b>Isolate traffic through a different Tor circuit, improving anonymity</b>`torsocks [[-i|--isolate]] [curl https://check.torproject.org/api/ip]`<br><b>Connect to a Tor proxy running on a specific address and port</b>`torsocks [[-a|--address]] [ip] [[-P|--port]] [port] [command]`


title: TLDR
content:
<b>Open a given serial port</b>`sudo cu [[-l|--line]] [/dev/ttyXYZ]`<br><b>Open a given serial port with a given baud rate</b>`sudo cu [[-l|--line]] [/dev/ttyXYZ] [[-s|--speed]] [115200]`<br><b>Open a given serial port with a given baud rate and echo characters locally (half-duplex mode)</b>`sudo cu [[-l|--line]] [/dev/ttyXYZ] [[-s|--speed]] [115200] [[-h|--halfduplex]]`<br><b>Open a given serial port with a given baud rate, parity, and no hardware or software flow control</b>`sudo cu [[-l|--line]] [/dev/ttyXYZ] [[-s|--speed]] [115200] --parity=[even|odd|none] [[-f|--nortscts]] --nostop`<br><b>Exit the cu session when in connection</b>`<Enter><~><.>`<br><b>Display help</b>`cu --help`


title: TLDR
content:
<b>Initialize the repository that matches the path in /etc/pacman.conf</b>`repo-add [path/to/database.db.tar.gz]`<br><b>Search the AUR database for a package</b>`aur search [keyword]`<br><b>Download one or more packages and their dependencies from the AUR, build them, and add them to a local repository</b>`aur sync [package1 package2 ...]`<br><b>List packages available in your local repository</b>`aur repo [[-l|--list]]`<br><b>Upgrade local repository packages</b>`aur sync [[-u|--upgrades]]`<br><b>Clean build files after install</b>`aur sync [[-C|--clean]] [package]`<br><b>Install a package without viewing changes in Vim and do not confirm dependency installation</b>`aur sync --noview [[-n|--noconfirm]] [package]`<br><b>Remove a package form the repository metadata (does not remove the package file itself)</b>`repo-remove [path/to/database.db.tar.gz] [package]`


title: TLDR
content:
<b>Display the time</b>`cacaclock`<br><b>Change the font</b>`cacaclock [[-f|--font]] [font]`<br><b>Change the format using an strftime format specification</b>`cacaclock [[-d|--dateformat]] [strftime_arguments]`


title: TLDR
content:
<b>Register (command) a new reservation with a given key on a given device</b>`blkpr [[-c|--command]] register [[-k|--key]] [reservation_key] [path/to/device]`<br><b>Set the type of an existing reservation to exclusive access</b>`blkpr [[-c|--command]] reserve [[-k|--key]] [reservation_key] [[-t|--type]] exclusive-access [path/to/device]`<br><b>Preempt the existing reservation with a given key and replace it with a new reservation</b>`blkpr [[-c|--command]] preempt [[-K|--oldkey]] [old_key] [[-k|--key]] [new_key] [[-t|--type]] write-exclusive [path/to/device]`<br><b>Release a reservation with a given key and type on a given device</b>`blkpr [[-c|--command]] release [[-k|--key]] [reservation_key] [[-t|--type]] [reservation_type] [path/to/device]`<br><b>Clear all reservations from a given device</b>`blkpr [[-c|--command]] clear [[-k|--key]] [key] [path/to/device]`


title: TLDR
content:
<b>Launch Yazi from the current directory</b>`yazi`<br><b>Print debug information</b>`yazi --debug`<br><b>Write the current working directory on exit to the file</b>`yazi --cwd-file [path/to/cwd_file]`<br><b>Clear the cache directory</b>`yazi --clear-cache`


title: TLDR
content:
<b>Initialize a new project</b>`pixi init [path/to/project]`<br><b>Add project dependencies</b>`pixi add [dependency1 dependency2 ...]`<br><b>Start a pixi shell in the project environment</b>`pixi shell`<br><b>Run a task in the project environment</b>`pixi run [task]`<br><b>Manage tasks in the project environment</b>`pixi task [command]`<br><b>Display help</b>`pixi [command] --help`<br><b>Clean environment and task cache</b>`pixi clean`


title: TLDR
content:
<b>Enter the typing test</b>`typeinc`<br><b>Display the top 10 rank list for input difficulty level</b>`typeinc [[-r|--ranklist]] [difficulty_level]`<br><b>Get random English words present in our wordlist</b>`typeinc [[-w|--words]] [word_count]`<br><b>Calculate hypothetical Typeinc score</b>`typeinc [[-s|--score]]`


title: TLDR
content:
<b>Print a file to stdout (status and progress messages are sent to stderr)</b>`ippeveps [path/to/file]`<br><b>Print a file from stdin to stdout</b>`[wget -O - https://example.com/file] | ippeveps`


title: TLDR
content:
<b>Create a repository in the local filesystem</b>`kopia repository create filesystem --path [path/to/local_repository]`<br><b>Create a repository on Amazon S3</b>`kopia repository create s3 --bucket [bucket_name] --access-key [AWS_access_key_id] --secret-access-key [AWS_secret_access_key]`<br><b>Connect to a repository</b>`kopia repository connect [repository_type] --path [path/to/repository]`<br><b>Create a snapshot of a directory</b>`kopia snapshot create [path/to/directory]`<br><b>List snapshots</b>`kopia snapshot list`<br><b>Restore a snapshot to a specific directory</b>`kopia snapshot restore [snapshot_id] [path/to/target_directory]`<br><b>Create a new policy</b>`kopia policy set --global --keep-latest [number_of_snapshots_to_keep] --compression [compression_algorithm]`<br><b>Ignore a specific file or folder from backups</b>`kopia policy set --global --add-ignore [path/to/file_or_folder]`


title: TLDR
content:
<b>Run the specified command with uncompressed versions of the compressed argument files</b>`zrun [cat] [path/to/file1.gz path/to/file2.bz2 ...]`


title: TLDR
content:
<b>Chat with the default provider (GPT-3.5-turbo)</b>`tgpt "[prompt]"`<br><b>Start multi-line interactive mode</b>`tgpt [[-m|--multiline]]`<br><b>Generate images and save them to the current directory</b>`tgpt [[-img|--image]] "[prompt]"`<br><b>Generate code with the default provider (GPT-3.5-turbo)</b>`tgpt [[-c|--code]] "[prompt]"`<br><b>Chat with a specific provider quietly (without animations)</b>`tgpt --provider [openai|opengpts|koboldai|phind|llama2|blackboxai] [[-q|--quiet]] [[-w|--whole]] "[prompt]"`<br><b>Generate and execute shell commands using a specific provider (with a confirmation prompt)</b>`tgpt --provider [llama2] [[-s|--shell]] "[prompt]"`<br><b>Prompt with an API key, model, max response length, temperature, and top_p (required when using openai provider)</b>`tgpt --provider openai --key "[api_key]" --model "[gpt-3.5-turbo]" --max-length [10] --temperature [0.7] --top_p [0.9] "[prompt]"`<br><b>Feed a file as additional pre-prompt input</b>`tgpt < [path/to/file] --provider [blackboxai] "[prompt]"`


title: TLDR
content:
<b>Login to Hugging Face Hub</b>`huggingface-cli login`<br><b>Display the name of the logged in user</b>`huggingface-cli whoami`<br><b>Log out</b>`huggingface-cli logout`<br><b>Print information about the environment</b>`huggingface-cli env`<br><b>Download files from an repository and print out the path (omit filenames to download entire repository)</b>`huggingface-cli download --repo-type [repo_type] [repo_id] [filename1 filename2 ...]`<br><b>Upload an entire folder or a file to Hugging Face</b>`huggingface-cli upload --repo-type [repo_type] [repo_id] [path/to/local_file_or_directory] [path/to/repo_file_or_directory]`<br><b>Scan cache to see downloaded repositories and their disk usage</b>`huggingface-cli scan-cache`<br><b>Delete the cache interactively</b>`huggingface-cli delete-cache`


title: TLDR
content:
<b>Convert the specified PGM image to Lisp Machine format</b>`pgmtolispm [path/to/input.pgm] > [path/to/output.lispm]`


title: TLDR
content:
<b>Find files by extension</b>`bfs [root_path] -name '[*.ext]'`<br><b>Find files matching multiple path/name patterns</b>`bfs [root_path] -path '[**/path/**/*.ext]' -or -name '[*pattern*]'`<br><b>Find directories matching a given name, in case-insensitive mode</b>`bfs [root_path] -type d -iname '[*lib*]'`<br><b>Find files matching a given pattern, excluding specific paths</b>`bfs [root_path] -name '[*.py]' -not -path '[*/site-packages/*]'`<br><b>Find files matching a given size range, limiting the recursive depth to "1"</b>`bfs [root_path] -maxdepth 1 -size [+500k] -size [-10M]`<br><b>Run a command for each file (use {} within the command to access the filename)</b>`bfs [root_path] -name '[*.ext]' -exec [wc -l] {} \;`<br><b>Find all files modified today and pass the results to a single command as arguments</b>`bfs [root_path] -daystart -mtime [-1] -exec [tar -cvf archive.tar] {} \+`<br><b>Find empty files (0 byte) or directories and delete them verbosely</b>`bfs [root_path] -type [f|d] -empty -delete -print`


title: TLDR
content:
<b>Register gcloud as a Docker credential helper</b>`gcloud auth configure-docker`<br><b>Create a cluster to run GKE containers</b>`gcloud container clusters create [cluster_name]`<br><b>List clusters for running GKE containers</b>`gcloud container clusters list`<br><b>Update kubeconfig to get kubectl to use a GKE cluster</b>`gcloud container clusters get-credentials [cluster_name]`<br><b>List tag and digest metadata for a container image</b>`gcloud container images list-tags [image]`<br><b>Describe an existing cluster for running containers</b>`gcloud container clusters describe [cluster_name]`


title: TLDR
content:
<b>Specify the target OVA file</b>`VBoxManage export --output [path/to/file.ova]`<br><b>Export in OVF 0.9 legacy mode</b>`VBoxManage export --legacy09`<br><b>Export in OVF (0.9|1.0|2.0) format</b>`VBoxManage export --[ovf09|ovf10|ovf20]`<br><b>Create manifest of the exported files</b>`VBoxManage export --manifest`<br><b>Specify a description of the VM</b>`VBoxManage export --description "[vm_description]"`


title: TLDR
content:
<b>View documentation for the Ruff linter</b>`tldr ruff check`<br><b>View documentation for the Ruff code formatter</b>`tldr ruff format`


title: TLDR
content:
<b>Deploy an app's code and configuration to the App Engine server</b>`gcloud app deploy [deployables]`<br><b>List all versions of all services deployed to the App Engine server</b>`gcloud app versions list`<br><b>Open the current app in a web browser</b>`gcloud app browse`<br><b>Create an App Engine app within the current project</b>`gcloud app create`<br><b>Display the latest App Engine app logs</b>`gcloud app logs read`


title: TLDR
content:
<b>Render a single line of text as a PBM image</b>`pbmtext "[Hello World!]" > [path/to/output.pbm]`<br><b>Render multiple lines of text as a PBM image</b>`echo "[Hello\nWorld!]" | pbmtext > [path/to/output.pbm]`<br><b>Render text using a custom font supplied as a PBM file</b>`pbmtext [[-f|-font]] [path/to/font.pbm] "[Hello World!]" > [path/to/output.pbm]`<br><b>Specify the number of pixels between characters and lines</b>`echo "[Hello\nWorld!]" | pbmtext [[-s|-space]] [3] [[-ls|-lspace]] [10] > [path/to/output.pbm]`


title: TLDR
content:
<b>Convert a PNM or PAM file into a Motif UIL icon file</b>`pamtouil [path/to/input.pnm|pam] > [path/to/output.uil]`<br><b>Specify a prefix string to be printed in the output UIL file</b>`pamtouil [[-n|-name]] [uilname] [path/to/input.pnm|pam] > [path/to/output.uil]`


title: TLDR
content:
<b>Create a new gleam project</b>`gleam new [project_name]`<br><b>Build and run a gleam project</b>`gleam run`<br><b>Build the project</b>`gleam build`<br><b>Run a project for a particular platform and runtime</b>`gleam run --target [platform] --runtime [runtime]`<br><b>Add a hex dependency to your project</b>`gleam add [dependency_name]`<br><b>Run project tests</b>`gleam test`<br><b>Format source code</b>`gleam format`<br><b>Type check the project</b>`gleam check`


title: TLDR
content:
<b>Show the current balances in Asset and Liability accounts, excluding zeros</b>`hledger [[bs|balancesheet]]`<br><b>Show just the liquid assets (Cash account type)</b>`hledger [[bs|balancesheet]] type:C`<br><b>Include accounts with zero balances, and show the account hierarchy</b>`hledger [[bs|balancesheet]] [[-E|--empty]] [[-t|--tree]]`<br><b>Show the balances at the end of each month</b>`hledger [[bs|balancesheet]] [[-M|--monthly]]`<br><b>Show the balances' market value in home currency at the end of each month</b>`hledger [[bs|balancesheet]] [[-M|--monthly]] [[-V|--market]]`<br><b>Show quarterly balances, with just the top two levels of account hierarchy</b>`hledger [[bs|balancesheet]] [[-Qt|--quarterly --tree]] [[-2|--depth 2]]`<br><b>Same as above above, and generate HTML output in bs.html</b>`hledger [[bs|balancesheet]] [[-Qt|--quarterly --tree]] [[-2|--depth 2]] [[-o|--output-file]] bs.html`


title: TLDR
content:
<b>Output a WAV [f]ile using a text-to-speech [m]odel (assuming a configuration file at model_path + .json)</b>`echo [Thing to say] | piper -m [path/to/model.onnx] -f [outputfile.wav]`<br><b>Output a WAV [f]ile using a [m]odel and specifying its JSON [c]onfig file</b>`echo [Thing to say] | piper -m [path/to/model.onnx] -c [path/to/model.onnx.json] -f [outputfile.wav]`<br><b>Select a particular speaker in a voice with multiple speakers by specifying the speaker's ID number</b>`echo [Warum?] | piper -m [de_DE-thorsten_emotional-medium.onnx] --speaker [1] -f [angry.wav]`<br><b>Stream the output to the mpv media player</b>`echo [Hello world] | piper -m [en_GB-northern_english_male-medium.onnx] --output-raw -f - | mpv -`<br><b>Speak twice as fast, with huge gaps between sentences</b>`echo [Speaking twice the speed. With added drama!] | piper -m [file.onnx] --length_scale [0.5] --sentence_silence [2] -f [drama.wav]`


title: TLDR
content:
<b>Search for URLs of a domain (output will typically be in ~/.config/waymore/results/)</b>`waymore [[-i|--input]] [example.com]`<br><b>Limit search results to only include a list of URLs for a domain and store outputs to the specified file</b>`waymore -mode U [[-oU|--output-urls]] [path/to/example.com-urls.txt] [[-i|--input]] [example.com]`<br><b>Only output the content bodies of URLs and store outputs to the specified directory</b>`waymore -mode R [[-oR|--output-responses]] [path/to/example.com-url-responses] [[-i|--input]] [example.com]`<br><b>Filter the results by specifying date ranges</b>`waymore -from [YYYYMMDD|YYYYMM|YYYY] [[-to|--to-date]] [YYYYMMDD|YYYYMM|YYYY] [[-i|--input]] [example.com]`


title: TLDR
content:
<b>Stop one or more destination(s)</b>`cupsdisable [destination1 destination2 ...]`<br><b>Cancel all jobs of the specified destination(s)</b>`cupsdisable -c [destination1 destination2 ...]`


title: TLDR
content:
<b>Run a QEMU virtual machine</b>`virt-qemu-run [path/to/guest.xml]`<br><b>Run a QEMU virtual machine and store the state in a specific directory</b>`virt-qemu-run [[-r|--root]] [path/to/directory] [path/to/guest.xml]`<br><b>Run a QEMU virtual machine and display verbose information about the startup</b>`virt-qemu-run [[-v|--verbose]] [path/to/guest.xml]`<br><b>Display help</b>`virt-qemu-run [[-h|--help]]`


title: TLDR
content:
<b>Map all greyscale values of the input image to all colors between the two specified colors</b>`pgmtoppm [[-b|-black]] [red] [[-w|-white]] [blue] [path/to/input.pgm] > [path/to/output.ppm]`<br><b>Map all greyscale values of the input image to colors according to the specified colormap</b>`pgmtoppm [[-m|-map]] [path/to/colormap.ppm] [path/to/input.pgm] > [path/to/output.ppm]`


title: TLDR
content:
<b>Convert a PPM image to an ASCII image, combining an area of 1x2 pixels into a character</b>`ppmtoascii [path/to/input.ppm] > [path/to/output.txt]`<br><b>Convert a PPM image to an ASCII image, combining an area of 2x4 pixels into a character</b>`ppmtoascii -2x4 [path/to/input.ppm] > [path/to/output.txt]`


title: TLDR
content:
<b>Create a new Python project in the current directory</b>`uv init`<br><b>Create a new Python project at the specified path</b>`uv init [path/to/directory]`<br><b>Add a new dependency to the project</b>`uv add [package]`<br><b>Remove a dependency from the project</b>`uv remove [package]`<br><b>Run a script in the project's environment</b>`uv run [path/to/script.py]`<br><b>Run a command in the project's environment</b>`uv run [command]`<br><b>Update a project's environment from pyproject.toml</b>`uv sync`<br><b>Create a lock file for the project's dependencies</b>`uv lock`


title: TLDR
content:
<b>Convert a PPM image into an Atari Degas PI1 image</b>`ppmtopi1 [path/to/image.ppm] > [path/to/output_image.pi1]`


title: TLDR
content:
<b>Start editing a zone</b>`knotc zone-begin [zone]`<br><b>Set an A record with TTL of 3600</b>`knotc zone-set [zone] [subdomain] 3600 A [ip_address]`<br><b>Finish editing the zone</b>`knotc zone-commit [zone]`<br><b>Get the current zone data</b>`knotc zone-read [zone]`<br><b>Get the current server configuration</b>`knotc conf-read server`


title: TLDR
content:
<b>Create a new task</b>`pixi task add [task_name] [task_command]`<br><b>List all tasks in the project</b>`pixi task list`<br><b>Remove a task</b>`pixi task remove [task_name]`<br><b>Create an alias for a task</b>`pixi task alias [alias_name] [task1 task2 ...]`


title: TLDR
content:
<b>Output the information in warts files as text</b>`sc_warts2text [path/to/file1.warts path/to/file2.warts ...]`


title: TLDR
content:
<b>[l]ist all connected Rockchip-based flash [d]evices</b>`rkdeveloptool ld`<br><b>Initialize the device by forcing it to [d]ownload and install the [b]ootloader from the specified file</b>`rkdeveloptool db [path/to/bootloader.bin]`<br><b>[u]pdate the boot[l]oader software with a new one</b>`rkdeveloptool ul [path/to/bootloader.bin]`<br><b>Write an image to a GPT-formatted flash partition, specifying the initial storage sector (usually 0x0 alias 0)</b>`rkdeveloptool wl [initial_sector] [path/to/image.img]`<br><b>Write to the flash partition by its user-friendly name</b>`rkdeveloptool wlx [partition_name] [path/to/image.img]`<br><b>[r]eset/reboot the [d]evice, exit from the Maskrom/Bootrom mode to boot into the selected flash partition</b>`rkdeveloptool rd`


title: TLDR
content:
<b>Force the brightest pixels to be white, the darkest pixels to be black and spread out the ones in between linearly</b>`pnmnorm [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Force the brightest pixels to be white, the darkest pixels to be black and spread out the ones in between quadratically such that pixels with a brightness of n become 50 % bright</b>`pnmnorm [[-midv|-midvalue]] [n] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Keep the pixels' hue, only modify the brightness</b>`pnmnorm [[-k|-keephues]] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Specify a method to calculate a pixel's brightness</b>`pnmnorm -[luminosity|colorvalue|saturation] [path/to/image.pnm] > [path/to/output.pnm]`


title: TLDR
content:
<b>Display a PBM image on an AT&T 4425 terminal using the terminal's mosaic graphics character set</b>`pbmto4425 [path/to/image.pbm]`


title: TLDR
content:
<b>Manage project channels</b>`pixi project channel [command]`<br><b>Manage project description</b>`pixi project description [command]`<br><b>Manage project platform</b>`pixi project platform [command]`<br><b>Manage project version</b>`pixi project version [command]`<br><b>Manage project environment</b>`pixi project environment [command]`


title: TLDR
content:
<b>View documentation for pages related to standard streams</b>`tldr [ifne|mispipe|pee|sponge|vipe|vidir]`<br><b>View documentation for other pages</b>`tldr [combine|errno|ifdata|isutt8|lckdo|parallel|zrun]`


title: TLDR
content:
<b>Run in portable mode</b>`QOwnNotes --portable`<br><b>Dump settings and other information about the app and environment in GitHub Markdown</b>`QOwnNotes --dump-settings`<br><b>Specify a different context for settings and internal files</b>`QOwnNotes --session [test]`<br><b>Trigger a menu action after the application was started</b>`QOwnNotes --action [actionShow_Todo_List]`


title: TLDR
content:
<b>Connect to a serial console with the default baud rate of 9600</b>`sudo picocom [/dev/ttyXYZ]`<br><b>Connect to a serial console with a specified baud rate</b>`sudo picocom [/dev/ttyXYZ] [[-b|--baud]] [baud_rate]`<br><b>Map special characters (e.g. LF to CRLF)</b>`sudo picocom [/dev/ttyXYZ] --imap [lfcrlf]`<br><b>Exit picocom</b>`<Ctrl a><Ctrl x>`<br><b>Display help</b>`picocom [[-h|--help]]`


title: TLDR
content:
<b>Search for valid domain credentials by trying out every combination in the specified lists of usernames and passwords</b>`nxc smb [192.168.178.2] [[-u|--username]] [path/to/usernames.txt] [[-p|--password]] [path/to/passwords.txt]`<br><b>Search for valid credentials for local accounts instead of domain accounts</b>`nxc smb [192.168.178.2] [[-u|--username]] [path/to/usernames.txt] [[-p|--password]] [path/to/passwords.txt] --local-auth`<br><b>Enumerate SMB shares and the specified users' access rights to them on the target hosts</b>`nxc smb [192.168.178.0/24] [[-u|--username]] [username] [[-p|--password]] [password] --shares`<br><b>Enumerate network interfaces on the target hosts, performing authentication via pass-the-hash</b>`nxc smb [192.168.178.30-45] [[-u|--username]] [username] [[-H|--hash]] [NTLM_hash] --interfaces`<br><b>Scan the target hosts for common vulnerabilities</b>`nxc smb [path/to/target_list.txt] [[-u|--username]] '' [[-p|--password]] '' [[-M|--module]] zerologon [[-M|--module]] petitpotam`<br><b>Attempt to execute a command on the target hosts</b>`nxc smb [192.168.178.2] [[-u|--username]] [username] [[-p|--password]] [password] -x [command]`


title: TLDR
content:
<b>Send packets to all devices on the local network (255.255.255.255) by specifying a MAC address</b>`wakeonlan [01:02:03:04:05:06]`<br><b>Send packet to a specific device via IP address</b>`wakeonlan [01:02:03:04:05:06] [[-i|--ip]] [192.168.178.2]`<br><b>Print the commands, but don't execute them (dry-run)</b>`wakeonlan [[-n|--dry-run]] [01:02:03:04:05:06]`<br><b>Run in quiet mode</b>`wakeonlan [[-q|--quiet]] [01:02:03:04:05:06]`


title: TLDR
content:
<b>Check whether the recorded BLE communications contain the packets necessary for recovering temporary keys (TKs)</b>`crackle -i [path/to/input.pcap]`<br><b>Use brute force to recover the TK of the recorded pairing events and use it to decrypt all subsequent communications</b>`crackle -i [path/to/input.pcap] -o [path/to/decrypted.pcap]`<br><b>Use the specified long-term key (LTK) to decrypt the recorded communication</b>`crackle -i [path/to/input.pcap] -o [path/to/decrypted.pcap] -l [81b06facd90fe7a6e9bbd9cee59736a7]`


title: TLDR
content:
<b>Output the content of warts files verbose</b>`sc_wartsdump [path/to/file1.warts path/to/file2.warts ...]`


title: TLDR
content:
<b>Play/pause audio playback</b>`audtool playback-playpause`<br><b>Print artist, album, and song name of currently playing song</b>`audtool current-song`<br><b>Set volume of audio playback</b>`audtool set-volume [100]`<br><b>Skip to the next song</b>`audtool playlist-advance`<br><b>Print the bitrate of the current song in kilobits</b>`audtool current-song-bitrate-kbps`<br><b>Open Audacious in full-screen if hidden</b>`audtool mainwin-show`<br><b>Display help</b>`audtool help`<br><b>Display settings</b>`audtool preferences-show`


title: TLDR
content:
<b>Compare two files or directories</b>`difft [path/to/file_or_directory1] [path/to/file_or_directory2]`<br><b>Only report the presence of differences between the files</b>`difft --check-only [path/to/file1] [path/to/file2]`<br><b>Specify the display mode (default is side-by-side)</b>`difft --display [side-by-side|side-by-side-show-both|inline|json] [path/to/file1] [path/to/file2]`<br><b>Ignore comments when comparing</b>`difft --ignore-comments [path/to/file1] [path/to/file2]`<br><b>Enable/Disable syntax highlighting of source code (default is on)</b>`difft --syntax-highlight [on|off] [path/to/file1] [path/to/file2]`<br><b>Do not output anything at all if there are no differences between files</b>`difft --skip-unchanged [path/to/file_or_directory1] [path/to/file_or_directory2]`<br><b>Print all programming languages supported by the tool, along with their extensions</b>`difft --list-languages`


title: TLDR
content:
<b>Convert an MTV or PRT ray tracer file to a PPM image</b>`mtvtoppm [path/to/file.mtv] > [path/to/output.ppm]`


title: TLDR
content:
<b>Run the previous command replacing string1 with string2</b>`^[string1]^[string2]`<br><b>Remove string1 from the previous command</b>`^[string1]^`<br><b>Replace string1 with string2 in the previous command and add string3 to its end</b>`^[string1]^[string2]^[string3]`<br><b>Replace all occurrences of string1</b>`^[string1]^[string2]^:g&`<br><b>Print the substituted command without running it</b>`^[string1]^[string2]^:p`


title: TLDR
content:
<b>Provide feedback to the gcloud team</b>`gcloud feedback`<br><b>Provide feedback to the gcloud team and attach a log file</b>`gcloud feedback --log-file [log_file]`


title: TLDR
content:
<b>Run pnmquant on multiple files with the specified parameters, overwriting the original files</b>`pnmquantall [n_colors] [path/to/input1.pnm path/to/input2.pnm ...]`<br><b>Save the quantised images to files named the same as the input files, but with the specified extension appended</b>`pnmquantall [[-e|-ext]] [extension] [n_colors] [path/to/input1.pnm path/to/input2.pnm ...]`


title: TLDR
content:
<b>Show a short summary of a specific topic on Wikipedia</b>`wikit [topic]`<br><b>Specify a language (ISO 639-1 language code)</b>`wikit [topic] [[-l|--lang]] [language_code]`<br><b>Open the full Wikipedia article in the default browser</b>`wikit [topic] -b`<br><b>Open a disambiguation menu</b>`wikit [topic] -d`


title: TLDR
content:
<b>Upload a Google Photos takeout file to Immich server</b>`immich-go -server=[server_url] -key=[server_key] upload [path/to/takeout_file.zip]`<br><b>Import photos captured on June 2019, while auto-generating albums</b>`immich-go -server=[server_url] -key=[server_key] upload -create-albums -google-photos -date=[2019-06] [path/to/takeout_file.zip]`<br><b>Upload a takeout file using server and key from a configuration file</b>`immich-go -use-configuration=[~/.immich-go/immich-go.json] upload [path/to/takeout_file.zip]`<br><b>Examine Immich server content, remove less quality images, and preserve albums</b>`immich-go -server=[server_url] -key=[server_key] duplicate -yes`<br><b>Delete all albums created with the pattern "YYYY-MM-DD"</b>`immich-go -server=[server_url] -key=[server_key] tool album delete [\d{4}-\d{2}-\d{2]}`


title: TLDR
content:
<b>Run each command, providing each one with a distinct copy of stdin</b>`pee [command1 command2 ...]`<br><b>Write a copy of stdin to stdout (like tee)</b>`pee cat [command1 command2 ...]`<br><b>Immediately terminate upon SIGPIPEs and write errors</b>`pee --no-ignore-sigpipe --no-ignore-write-errors [command1 command2 ...]`


title: TLDR
content:
<b>Update nuclei templates to the latest released version (downloaded to ~/nuclei-templates on macOS/Linux or %USERPROFILE%\nuclei-templates on Windows)</b>`nuclei [[-ut|-update-templates]]`<br><b>[l]ist all [t]emplates by specific [p]rotocol [t]ype</b>`nuclei -tl [[-pt|-type]] [dns|file|http|headless|tcp|workflow|ssl|websocket|whois|code|javascript]`<br><b>Run an automatic web scan using Wappalyzer technology detection for a specific target [u]RL/host</b>`nuclei [[-as|-automatic-scan]] [[-u|-target]] [example.com]`<br><b>Run HTTP [p]rotocol [t]ype templates of specific severity, exporting results to markdown files inside a specific directory</b>`nuclei [[-s|-severity]] [high,critical,...] [[-pt|-type]] http [[-u|-target]] [https://example.com] [[-me|-markdown-export]] [path/to/directory]`<br><b>Run all templates with a custom rate limit, maximum bulk size, and silent output (only findings shown)</b>`nuclei [[-rl|-rate-limit]] [150] [[-bs|-bulk-size]] [25] [[-c|-concurrency]] [25] -silent [[-u|-target]] [https://example.com]`<br><b>Run a specific nuclei-bundled workflow against a target</b>`nuclei [[-w|-workflows]] [workflows/wordpress-workflow.yaml] [[-u|-target]] [https://example.com]`<br><b>Run one or more specific templates or directory with templates with verbose output in stderr and output detected issues/vulnerabilities to a file</b>`nuclei [[-t|-templates]] [path/to/nuclei-templates/http] [[-u|-target]] [https://example.com] [[-v|-verbose]] [[-o|-output]] [path/to/results]`<br><b>Run a scan based on one or more template conditions</b>`nuclei [[-tc|-template-condition]] "[contains(tags, 'xss') && contains(tags, 'cve')]" [[-u|-target]] [https://example.com]`


title: TLDR
content:
<b>Start the DBMS</b>`neo4j-admin server start`<br><b>Stop the DBMS</b>`neo4j-admin server stop`<br><b>Set the initial password of the default neo4j user (prerequisite for the first start of the DBMS)</b>`neo4j-admin dbms set-initial-password [database_name]`<br><b>Create an archive (dump) of an offline database to a file named database_name.dump</b>`neo4j-admin database dump --to-path=[path/to/directory] [database_name]`<br><b>Load a database from an archive named database_name.dump</b>`neo4j-admin database load --from-path=[path/to/directory] [database_name] --overwrite-destination=true`<br><b>Load a database from a specified archive file through stdin</b>`neo4j-admin < [path/to/file.dump] database load --from-stdin [database_name] --overwrite-destination=true`<br><b>Display help</b>`neo4j-admin --help`


title: TLDR
content:
<b>Convert a Netpbm image into an unanimated GIF image</b>`pamtogif [path/to/image.pam] > [path/to/output.gif]`<br><b>Mark the specified color as transparent in the output GIF file</b>`pamtogif [[-t|-transparent]] [color] [path/to/image.pam] > [path/to/output.gif]`<br><b>Include the specified text as a comment in the output GIF file</b>`pamtogif [[-c|-comment]] "[Hello World!]" [path/to/image.pam] > [path/to/output.gif]`


title: TLDR
content:
<b>Add borders of the specified sizes to the image</b>`pnmpad [[-l|-left]] [100] [[-ri|-right]] [150] [[-t|-top]] [123] [[-bo|-bottom]] [456] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Pad the image to the specified size</b>`pnmpad [[-wi|-width]] [1000] [[-he|-height]] [500] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Pad the width of the image to the specified size, controlling the ratio between right and left padding</b>`pnmpad [[-wi|-width]] [1000] [[-ha|-halign]] [0.7] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Pad the width of the image using the specified color</b>`pnmpad [[-wi|-width]] [1000] [[-c|-color]] [red] [path/to/image.pnm] > [path/to/output.pnm]`


title: TLDR
content:
<b>Start the typing test with the default wordlist</b>`toipe`<br><b>Use a specific wordlist</b>`toipe [[-w|--wordlist]] [wordlist_name]`<br><b>Use a custom wordlist</b>`toipe [[-f|--file]] [path/to/file]`<br><b>Specify the number of words on each test</b>`toipe [[-n|--num]] [number_of_words]`<br><b>Include punctuation</b>`toipe [[-p|--punctuation]]`


title: TLDR
content:
<b>Generate an image using only n_colors or less colors as close as possible to the input image</b>`pnmcolormap [n_colors] [path/to/input.pnm] > [path/to/output.ppm]`<br><b>Use the splitspread strategy for determining the output colors, possibly producing a better result for images with small details</b>`pnmcolormap [[-splits|-splitspread]] [n_colors] [path/to/input.pnm] > [path/to/output.ppm]`<br><b>Sort the resulting colormap, which is useful for comparing colormaps</b>`pnmcolormap [[-so|-sort]] [path/to/input.pnm] > [path/to/output.ppm]`


title: TLDR
content:
<b>Convert a PNM image to a Palm bitmap</b>`pnmtopalm [path/to/file.pnm] > [path/to/file.palm]`<br><b>Specify the color depth of the resulting bitmap</b>`pnmtopalm [[-dep|-depth]] [1|2|4|8|16] [path/to/file.pnm] > [path/to/file.palm]`<br><b>Choose a compression method for the resulting bitmap</b>`pnmtopalm -[scanline_compression|rle_compression|packbits_compression] [path/to/file.pnm] > [path/to/file.palm]`<br><b>Build a custom colormap and include it in the resulting bitmap</b>`pnmtopalm [[-c|-colormap]] [path/to/file.pnm] > [path/to/file.palm]`<br><b>Specify the bitmap's density</b>`pnmtopalm [[-den|-density]] [72|108|144|216|288] [path/to/file.pnm] > [path/to/file.palm]`


title: TLDR
content:
<b>Draw a histogram of a PNM image</b>`pnmhistmap [path/to/input.pnm] > [path/to/output.pnm]`<br><b>Draw the histogram as dots instead of bars</b>`pnmhistmap [[-d|-dots]] [path/to/input.pnm] > [path/to/output.pnm]`<br><b>Specify the range of intensity values to include</b>`pnmhistmap [[-l|-lval]] [minval] [[-rv|-rval]] [maxval] [path/to/input.pnm] > [path/to/output.pnm]`


title: TLDR
content:
<b>Display general information about the OATH application</b>`ykman oath info`<br><b>Change the password used to protect OATH accounts (add --clear to remove it)</b>`ykman oath access change`<br><b>Add a new account (the issuer is optional)</b>`ykman oath accounts add [[-i|--issuer]] [issuer] [name]`<br><b>List all accounts (with their issuers)</b>`ykman oath accounts list`<br><b>List all accounts with their current TOTP/HOTP codes (optionally filtering the list with a keyword)</b>`ykman oath accounts code [keyword]`<br><b>Rename an account</b>`ykman oath accounts rename [keyword] [issuer:name|name]`<br><b>Delete an account</b>`ykman oath accounts delete [keyword]`<br><b>Delete all accounts and restore factory settings</b>`ykman oath reset`


title: TLDR
content:
<b>Convert a ESC/P2 printer file to a PBM image</b>`escp2topbm [path/to/image.escp2] > [path/to/output.pbm]`


title: TLDR
content:
<b>Run a BATS test script and output results in the TAP (Test Anything Protocol) format</b>`bats [[-t|--tap]] [path/to/test.bats]`<br><b>Count test cases of a test script without running any tests</b>`bats [[-c|--count]] [path/to/test.bats]`<br><b>Run BATS test cases recursively (files with a .bats extension)</b>`bats [[-r|--recursive]] [path/to/directory]`<br><b>Output results in a specific format</b>`bats [[-F|--formatter]] [pretty|tap|tap13|junit] [path/to/test.bats]`<br><b>Add timing information to tests</b>`bats [[-T|--timing]] [path/to/test.bats]`<br><b>Run specific number of jobs in parallel (requires GNU parallel to be installed)</b>`bats [[-j|--jobs]] [number] [path/to/test.bats]`


title: TLDR
content:
<b>Remake the configuration file storing into a specific location</b>`tlmgr generate --dest [output_file]`<br><b>Remake the configuration file using a local configuration file</b>`tlmgr generate --localcfg [local_configuration_file]`<br><b>Run necessary programs after rebuilding configuration files</b>`tlmgr generate --rebuild-sys`


title: TLDR
content:
<b>Convert the specified Usenix FaceSaver file into a PGM image</b>`fstopgm [path/to/input.fs] > [path/to/output.pgm]`


title: TLDR
content:
<b>Convert an Atari Degas PI1 image into PPM image</b>`pi1toppm [path/to/atari_image.pi1] > [path/to/image.ppm]`


title: TLDR
content:
<b>Show all accounts used or declared in the default journal file</b>`hledger [[acc|accounts]]`<br><b>Show accounts used by transactions</b>`hledger [[acc|accounts]] [[-u|--used]]`<br><b>Show accounts declared with account directives</b>`hledger [[acc|accounts]] [[-d|--declared]]`<br><b>Add new account directives, for accounts used but not declared, to the journal</b>`hledger [[acc|accounts]] --undeclared --directives >> [2024-accounts.journal]`<br><b>Show accounts with asset in their name, and their declared/inferred types</b>`hledger [[acc|accounts]] asset --types`<br><b>Show accounts of the Asset type</b>`hledger [[acc|accounts]] type:A`<br><b>Show the first two levels of the accounts hierarchy</b>`hledger [[acc|accounts]] [[-t|--tree]] [[-2|--depth 2]]`


title: TLDR
content:
<b>Get all secrets</b>`doppler secrets`<br><b>Get value(s) of one or more secrets</b>`doppler secrets get [secrets]`<br><b>Upload a secrets file</b>`doppler secrets upload [path/to/file.env]`<br><b>Delete value(s) of one or more secrets</b>`doppler secrets delete [secrets]`<br><b>Download secrets as .env</b>`doppler secrets download --format=env --no-file > [path/to/.env]`


title: TLDR
content:
<b>Apply the "alpha trimmed mean" filter with the specified alpha and radius values onto the PNM image</b>`pnmnlfilt [0.0..0.5] [radius] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Apply the "optimal estimation smoothing" filter with the specified noise threshold and radius onto the PNM image</b>`pnmnlfilt [1.0..2.0] [radius] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Apply the "edge enhancement" filter with the specified alpha and radius onto the PNM image</b>`pnmnlfilt [-0.9..(-0.1)] [radius] [path/to/image.pnm] > [path/to/output.pnm]`


title: TLDR
content:
<b>Update the list of available packages</b>`upt update`<br><b>Search for a given package</b>`upt search [search_term]`<br><b>Show information for a package</b>`upt info [package]`<br><b>Install a given package</b>`upt install [package]`<br><b>Remove a given package</b>`upt [remove|uninstall] [package]`<br><b>Upgrade all installed packages</b>`upt upgrade`<br><b>Upgrade a given package</b>`upt upgrade [package]`<br><b>List installed packages</b>`upt list`


title: TLDR
content:
<b>Produce a packing of the specified images</b>`pnmmontage [path/to/image1.pnm path/to/image2.pnm ...] > [path/to/output.pnm]`<br><b>Specify the quality of the packing (Note: Larger values produce smaller packings but take longer to compute.)</b>`pnmmontage -[0..9] [path/to/image1.pnm path/to/image2.pnm ...] > [path/to/output.pnm]`<br><b>Produce a packing that is not larger than p percent of the optimal packing</b>`pnmmontage [[-qua|-quality]] [p] [path/to/image1.pnm path/to/image2.pnm ...] > [path/to/output.pnm]`<br><b>Write the positions of the input files within the packed image to a machine-readable file</b>`pnmmontage [[-d|-data]] [path/to/datafile] [path/to/image1.pnm path/to/image2.pnm ...] > [path/to/output.pnm]`


title: TLDR
content:
<b>Tile the input image xtiles by ytiles times, increasing the offset each time as determined by xdelta and ydelta</b>`pampop9 [path/to/input.pam] [xtiles] [ytiles] [xdelta] [ydelta] > [path/to/output.pam]`


title: TLDR
content:
<b>Search for valid domain credentials by trying out every combination in the specified lists of usernames and passwords</b>`nxc ldap [192.168.178.2] [[-u|--username]] [path/to/usernames.txt] [[-p|--password]] [path/to/passwords.txt]`<br><b>Enumerate active domain users</b>`nxc ldap [192.168.178.2] [[-u|--username]] [username] [[-p|--password]] [password] --active-users`<br><b>Collect data about the targeted domain and automatically import these data into BloodHound</b>`nxc ldap [192.168.178.2] [[-u|--username]] [username] [[-p|--password]] [password] --bloodhound [[-c|--collection]] [All]`<br><b>Attempt to collect AS_REP messages for the specified user in order to perform an ASREPRoasting attack</b>`nxc ldap [192.168.178.2] [[-u|--username]] [username] [[-p|--password]] '' --asreproast [path/to/output.txt]`<br><b>Attempt to extract the passwords of group managed service accounts on the domain</b>`nxc ldap [192.168.178.2] [[-u|--username]] [username] [[-p|--password]] [password] --gmsa`


title: TLDR
content:
<b>Authenticate to Immich server</b>`immich login [server_url/api] [server_key]`<br><b>Upload some image files</b>`immich upload [file1.jpg file2.jpg ...]`<br><b>Upload a directory including subdirectories</b>`immich upload --recursive [path/to/directory]`<br><b>Create an album based on a directory</b>`immich upload --album-name "[My summer holiday]" --recursive [path/to/directory]`<br><b>Skip assets matching a glob pattern</b>`immich upload --ignore [**/Raw/** **/*.tif] --recursive [path/to/directory]`<br><b>Include hidden files</b>`immich upload --include-hidden --recursive [path/to/directory]`


title: TLDR
content:
<b>Convert a PBM image into a PPA file</b>`pbmtoppa [path/to/image.pbm] > [path/to/output.ppa]`<br><b>Specify the desired dots-per-inch and paper size</b>`pbmtoppa -d [300] -s [a4] [path/to/image.pbm] > [path/to/output.ppa]`


title: TLDR
content:
<b>Update all components to the latest version</b>`gcloud components update`<br><b>Update all components to a specific version</b>`gcloud components update --version=[1.2.3]`<br><b>Update components without confirmation (useful for automation scripts)</b>`gcloud components update --quiet`


title: TLDR
content:
<b>Start in interactive mode</b>`gpg-card`<br><b>Invoke one or more commands non-interactively</b>`gpg-card [command1] -- [command2] -- [command3]`<br><b>Show information about a smart card</b>`gpg-card list`<br><b>Retrieve the public key using the URL stored on an OpenPGP card</b>`gpg-card fetch`<br><b>Set the URL used by the fetch command</b>`gpg-card url`<br><b>Change or unblock PINs (uses the default action for the card in non-interactive mode)</b>`gpg-card passwd`<br><b>Toggle the forcesig flag of an OpenPGP card (i.e. require entering the user PIN for signing)</b>`gpg-card forcesig`<br><b>Factory reset a smart card (i.e. delete all data and reset PINs)</b>`gpg-card factory-reset`


title: TLDR
content:
<b>List the instances in the specified state belonging to the specified compartment</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] list instances --state=[running|terminated|paused] --compartment-id=[compartment_id]`<br><b>Create a new instance</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] instance create --domain-name=[domain_name] --image-id=[image_id]`<br><b>Gather information about a particular instance</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] instance info --id=[unique_id]`<br><b>Terminate an instance</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] instance terminate --id=[unique_id]`<br><b>List images within a specific compartment and state</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] list images --compartment-id=[compartment_id] --state=[state_name]`<br><b>Create a new image</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] image create --instance-id=[instance_id] --display-name=[display_name] --compartment-id=[compartment_id]`<br><b>Retrieve information about a particular image</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] image info --id=[unique_id]`<br><b>Delete an image</b>`VBoxManage cloud --provider=[provider_name] --profile=[profile_name] image delete --id=[unique_id]`


title: TLDR
content:
<b>Generate a left-to-right greyscale map</b>`pgmramp -lr > [path/to/output.pgm]`<br><b>Generate a top-to-bottom greyscale map</b>`pgmramp -tb > [path/to/output.pgm]`<br><b>Generate a rectangular greyscale map</b>`pgmramp -rectangle > [path/to/output.pgm]`<br><b>Generate a elliptical greyscale map</b>`pgmramp -ellipse [path/to/image.pgm] > [path/to/output.pgm]`<br><b>Generate a greyscale map from the top-left corner to the bottom-right corner</b>`pgmramp -diagonal [path/to/image.pgm] > [path/to/output.pgm]`


title: TLDR
content:
<b>Create an index</b>`aws kendra create-index --name [name] --role-arn [role_arn]`<br><b>List indexes</b>`aws kendra list-indexes`<br><b>Describe an index</b>`aws kendra describe-index --id [index_id]`<br><b>List data sources</b>`aws kendra list-data-sources`<br><b>Describe a data source</b>`aws kendra describe-data-source --id [data_source_id]`<br><b>List search queries</b>`aws kendra list-query-suggestions --index-id [index_id] --query-text [query_text]`


title: TLDR
content:
<b>View documentation for a builtin [f]unction, a [v]ariable or an [a]PI</b>`perldoc -[f|v|a] [name]`<br><b>Search in the [q]uestion headings of Perl FAQ</b>`perldoc -q [regex]`<br><b>Send output directly to stdout (by default, it is send to a pager)</b>`perldoc -T [page|module|program|URL]`<br><b>Specify the language code of the desired translation</b>`perldoc -L [language_code] [page|module|program|URL]`


title: TLDR
content:
<b>Concatenate warts files into one</b>`sc_wartscat -o [path/to/output.warts] [path/to/file1.warts path/to/file2.warts ...]`


title: TLDR
content:
<b>Display gcloud environment information</b>`gcloud info`<br><b>Check network connectivity and hidden properties</b>`gcloud info --run-diagnostics`<br><b>Print the contents of the most recent log file</b>`gcloud info --show-log`


title: TLDR
content:
<b>Crawl a list of URLs</b>`katana -list [https://example.com,https://google.com,...]`<br><b>Crawl a [u]RL using headless mode using Chromium</b>`katana -u [https://example.com] [[-hl|-headless]]`<br><b>Pass requests through a proxy (http/socks5) and use custom headers from a file</b>`katana -proxy [http://127.0.0.1:8080] [[-H|-headers]] [path/to/headers.txt] -u [https://example.com]`<br><b>Specify the crawling strategy, depth of subdirectories to crawl, and rate limiting (requests per second)</b>`katana [[-s|-strategy]] [depth-first|breadth-first] [[-d|-depth]] [value] [[-rl|-rate-limit]] [value] -u [https://example.com]`<br><b>Find subdomains using subfinder, crawl each for a maximum number of seconds, and write results to an output file</b>`subfinder [[-dL|-list]] [path/to/domains.txt] | katana [[-ct|-crawl-duration]] [value] [[-o|-output]] [path/to/output.txt]`


title: TLDR
content:
<b>Start MySQL Shell in interactive mode</b>`mysqlsh`<br><b>Connect to a MySQL server</b>`mysqlsh --user [username] --host [hostname] --port [port]`<br><b>Execute an SQL statement on the server and exit</b>`mysqlsh --user [username] --execute '[sql_statement]'`<br><b>Start MySQL Shell in JavaScript mode</b>`mysqlsh --js`<br><b>Start MySQL Shell in Python mode</b>`mysqlsh --py`<br><b>Import JSON documents into a MySQL collection</b>`mysqlsh --import [path/to/file.json] --schema [schema_name] --collection [collection_name]`<br><b>Enable verbose output</b>`mysqlsh --verbose`


title: TLDR
content:
<b>View documentation for pnmquant</b>`tldr pnmquant`<br><b>View documentation for pnmremap</b>`tldr pnmremap`


title: TLDR
content:
<b>Compile and render a D2 source file into an output file</b>`d2 [path/to/input_file.d2] [path/to/output_file.ext]`<br><b>Watch live changes made to a D2 source file in the default web browser</b>`d2 [[-w|--watch]] [path/to/input_file.d2] [path/to/output_file.ext]`<br><b>Format a D2 source file</b>`d2 fmt [path/to/input_file.d2]`<br><b>List available themes</b>`d2 themes`<br><b>Use a different theme for the output file (list available themes first to get the desired theme_id)</b>`d2 [[-t|--theme]] [theme_id] [path/to/input_file.d2] [path/to/output_file.ext]`<br><b>Make rendered diagrams look like hand sketches</b>`d2 [[-s|--sketch]] true [path/to/input_file.d2] [path/to/output_file.ext]`


title: TLDR
content:
<b>Start the daemon required to run other commands</b>`ollama serve`<br><b>Run a model and chat with it</b>`ollama run [model]`<br><b>Run a model with a single prompt</b>`ollama run [model] [prompt]`<br><b>List downloaded models</b>`ollama [[ls|list]]`<br><b>Pull a specific model</b>`ollama pull [model]`<br><b>List running models</b>`ollama ps`<br><b>Delete a model</b>`ollama rm [model]`<br><b>Create a model from a Modelfile</b>`ollama create [new_model_name] [[-f|--file]] [path/to/Modelfile]`


title: TLDR
content:
<b>Fetch all URLs of a domain from AlienVault's Open Threat Exchange, the Wayback Machine, Common Crawl, and URLScan</b>`gau [example.com]`<br><b>Fetch URLs of multiple domains</b>`gau [domain1 domain2 ...]`<br><b>Fetch all URLs of several domains from an input file, running multiple threads</b>`gau < [path/to/domains.txt] --threads [4]`<br><b>Write [o]utput results to a file</b>`gau [example.com] --o [path/to/found_urls.txt]`<br><b>Search for URLs from only one specific provider</b>`gau --providers [wayback|commoncrawl|otx|urlscan] [example.com]`<br><b>Search for URLs from multiple providers</b>`gau --providers [wayback,otx,...] [example.com]`<br><b>Search for URLs within specific date range</b>`gau --from [YYYYMM] --to [YYYYMM] [example.com]`


title: TLDR
content:
<b>Edge-enhance a PGM image</b>`pgmenhance [path/to/image.pgm] > [path/to/output.pgm]`<br><b>Specify the level of enhancement</b>`pgmenhance -[1..9] [path/to/image.pgm] > [path/to/output.pgm]`


title: TLDR
content:
<b>Show current cache statistics</b>`ccache [[-s|--show-stats]]`<br><b>Clear all cache</b>`ccache [[-C|--clear]]`<br><b>Reset statistics (but not cache itself)</b>`ccache [[-z|--zero-stats]]`<br><b>Compile C code and cache compiled output (to use ccache on all gcc invocations, see the note above)</b>`ccache gcc [path/to/file.c]`


title: TLDR
content:
<b>Initialize a perlbrew environment</b>`perlbrew init`<br><b>List available Perl versions</b>`perlbrew available`<br><b>Install/uninstall a Perl version</b>`perlbrew [install|uninstall] [version]`<br><b>List perl installations</b>`perlbrew list`<br><b>Switch to an installation and set it as default</b>`perlbrew switch perl-[version]`<br><b>Use the system Perl again</b>`perlbrew off`<br><b>List installed CPAN modules for the installation in use</b>`perlbrew list-modules`<br><b>Clone CPAN modules from one installation to another</b>`perlbrew clone-modules [source_installation] [destination_installation]`


title: TLDR
content:
<b>Create an EKS Cluster</b>`aws eks create-cluster --name [cluster_name] --role-arn [eks_service_role_arn] --resources-vpc-config subnetIds=[subnet_ids],securityGroupIds=[security_group_ids]`<br><b>Update kubeconfig to connect to the EKS Cluster</b>`aws eks update-kubeconfig --name [cluster_name]`<br><b>List available EKS clusters</b>`aws eks list-clusters`<br><b>Describe EKS cluster details</b>`aws eks describe-cluster --name [cluster_name]`<br><b>Delete an EKS Cluster</b>`aws eks delete-cluster --name [cluster_name]`<br><b>List nodegroups in an EKS cluster</b>`aws eks list-nodegroups --cluster-name [cluster_name]`<br><b>Describe nodegroup details</b>`aws eks describe-nodegroup --cluster-name [cluster_name] --nodegroup-name [nodegroup_name]`


title: TLDR
content:
<b>Create an Xmake C project, consisting of a hello world and xmake.lua</b>`xmake create [[-l|--language]] [[c|clean]] [[-P|--project]] [project_name]`<br><b>Build and run an Xmake project</b>`xmake [[b|build]] [[r|run]]`<br><b>Run a compiled Xmake target directly</b>`xmake [[r|run]] [target_name]`<br><b>Configure a project's build targets</b>`xmake [[f|config]] [[-p |--plat=]][macosx|linux|iphoneos|...] [[-a |--arch=]][x86_64|i386|arm64|...] [[-m |--mode=]][debug|release]`<br><b>Install the compiled target to a directory</b>`xmake [[i|install]] [[-o |--installdir=]][path/to/directory]`


title: TLDR
content:
<b>Scan all ports of one or more comma-delimited addresses using the default values</b>`rustscan [[-a|--addresses]] [ip_or_hostname]`<br><b>Scan the top 1000 ports with service and version detection</b>`rustscan --top [[-a|--addresses]] [address_or_addresses]`<br><b>Scan a specific list of ports</b>`rustscan [[-p|--ports]] [port1,port2,...] [[-a|--addresses]] [address_or_addresses]`<br><b>Scan a specific range of ports</b>`rustscan [[-r|--range]] [start]-[end] [[-a|--addresses]] [address_or_addresses]`<br><b>Invoke nmap functionalities (Nmap's OS detection and default scripts)</b>`rustscan [[-a|--addresses]] [address_or_addresses] -- -O [[-sC|--script=default]]`<br><b>Scan with custom batch size (default: 4500) and timeout (default: 1500ms)</b>`rustscan [[-b|--batch-size]] [batch_size] [[-t|--timeout]] [timeout] [[-a|--addresses]] [address_or_addresses]`<br><b>Scan with specific port order</b>`rustscan --scan-order [serial|random] [[-a|--addresses]] [address_or_addresses]`<br><b>Scan in greppable mode (only output of the ports, no nmap)</b>`rustscan [[-g|--greppable]] [[-a|--addresses]] [address_or_addresses]`


title: TLDR
content:
<b>Record new transactions, saving to the default journal file</b>`hledger add`<br><b>Add transactions to 2024.journal, but also load 2023.journal for completions</b>`hledger add [[-f|--file]] [path/to/2024.journal] [[-f|--file]] [path/to/2023.journal]`<br><b>Provide answers for the first four prompts</b>`hledger add [today] '[best buy]' [expenses:supplies] '[$20]'`<br><b>Show add's options and documentation with $PAGER</b>`hledger add [[-h|--help]]`<br><b>Show add's documentation with info or man if available</b>`hledger help add`


title: TLDR
content:
<b>Launch a "Getting Started" workflow</b>`gcloud init`<br><b>Launch a workflow without diagnostics</b>`gcloud init --skip-diagnostics`<br><b>Use the console for authentication</b>`gcloud init --console-only`


title: TLDR
content:
<b>Print the values of the pixels in the n'th row in a table</b>`pamslice [[-r|-row]] [n] [path/to/image.pam]`<br><b>Print the values of the pixels in the n'th column in a table</b>`pamslice [[-c|-column]] [n] [path/to/image.pam]`<br><b>Consider the m'th plane of the input image only</b>`pamslice [[-r|-row]] [n] -plane [m] [path/to/image.pam]`<br><b>Produce output in a format suitable for input to an xmgr for visualisation</b>`pamslice [[-r|-row]] [n] [[-x|-xmgr]] [path/to/image.pam]`


title: TLDR
content:
<b>List available modules for the specified protocol</b>`nxc [smb|ssh|ldap|ftp|wmi|winrm|rdp|vnc|mssql] [[-L|--list-modules]]`<br><b>List the options available for the specified module</b>`nxc [smb|ssh|ldap|ftp|wmi|winrm|rdp|vnc|mssql] [[-M|--module]] [module_name] --options`<br><b>Specify an [o]ption for a module</b>`nxc [smb|ssh|ldap|ftp|wmi|winrm|rdp|vnc|mssql] [[-M|--module]] [module_name] -o [OPTION_NAME]=[option_value]`<br><b>View the options available for the specified protocol</b>`nxc [smb|ssh|ldap|ftp|wmi|winrm|rdp|vnc|mssql] [[-h|--help]]`


title: TLDR
content:
<b>Initialize a simple Java class</b>`jbang init [path/to/file.java]`<br><b>Initialize a Java class (useful for scripting)</b>`jbang init --template=[cli] [path/to/file.java]`<br><b>Use jshell to explore and use a script and any dependencies in a REPL editor</b>`jbang run --interactive`<br><b>Setup a temporary project to edit a script in an IDE</b>`jbang edit --open=[codium|code|eclipse|idea|netbeans|gitpod] [path/to/script.java]`<br><b>Run a Java code snippet (Java 9 and later)</b>`[echo 'Files.list(Paths.get("/etc")).forEach(System.out::println);'] | jbang -`<br><b>Run command-line application</b>`jbang [path/to/file.java] [command] [arg1 arg2 ...]`<br><b>Install a script on the user's $PATH</b>`jbang app install --name [command_name] [path/to/script.java]`<br><b>Install a specific version of JDK to be used with jbang</b>`jbang jdk install [version]`


title: TLDR
content:
<b>Identify vulnerabilities in the project</b>`pnpm audit`<br><b>Automatically fix vulnerabilities</b>`pnpm audit fix`<br><b>Generate a security report in JSON format</b>`pnpm audit --json > [path/to/audit-report.json]`<br><b>Audit only dev dependencies</b>`pnpm audit [[-D|--dev]]`<br><b>Audit only production dependencies</b>`pnpm audit [[-P|--prod]]`<br><b>Exclude optional dependencies from the audit</b>`pnpm audit --no-optional`<br><b>Ignore registry errors during the audit process</b>`pnpm audit --ignore-registry-errors`<br><b>Filter advisories by severity (low, moderate, high, critical)</b>`pnpm audit --audit-level [severity]`


title: TLDR
content:
<b>Display the histogram for human reading</b>`pgmhist [path/to/image.pgm]`<br><b>Display the median grey value</b>`pgmhist [[-me|-median]] [path/to/image.pgm]`<br><b>Display four quartile grey value</b>`pgmhist [[-qua|-quartile]] [path/to/image.pgm]`<br><b>Report the existence of invalid grey values</b>`pgmhist [[-f|-forensic]] [path/to/image.pgm]`<br><b>Display machine-readable output</b>`pgmhist [[-ma|-machine]] [path/to/image.pgm]`


title: TLDR
content:
<b>Convert the image from BT.709 luminance to radiance or sRGB luminance</b>`pnmgamma -[bt709tolinear|bt709tosrgb] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Convert the image from radiance or sRGB luminance to BT.709 luminance</b>`pnmgamma -[lineartobt709|srgbtobt709] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Specify the gamma value used for the gamma transfer function</b>`pnmgamma [[-ga|-gamma]] [value] [path/to/image.pnm] > [path/to/output.pnm]`<br><b>Specify the gamma value used for the gamma transfer function per color component</b>`pnmgamma [[-rg|-rgamma]] [value] [[-gg|-ggamma]] [value] [[-bg|-bgamma]] [value] [path/to/image.pnm] > [path/to/output.pnm]`


title: TLDR
content:
<b>Replicate an image to fill an area of the specified dimensions</b>`pnmtile [width] [height] [path/to/input.pnm] > [path/to/output.pnm]`


title: TLDR
content:
<b>Describe the format and basic characteristics of an image</b>`magick identify [path/to/image]`<br><b>Describe the format and verbose characteristics of an image</b>`magick identify -verbose [path/to/image]`<br><b>Collect dimensions of all JPEG files in the current directory and save them into a CSV file</b>`magick identify -format "[%f,%w,%h\n]" [*.jpg] > [path/to/filelist.csv]`


title: TLDR
content:
<b>Launch the GUI</b>`git gui`<br><b>Show a specific file with author name and commit hash on each line</b>`git gui blame [path/to/file]`<br><b>Open git gui blame in a specific revision</b>`git gui blame [revision] [path/to/file]`<br><b>Open git gui blame and scroll the view to center on a specific line</b>`git gui blame --line=[line] [path/to/file]`<br><b>Open a window to make one commit and return to the shell when it is complete</b>`git gui citool`<br><b>Open git gui citool in the "Amend Last Commit" mode</b>`git gui citool --amend`<br><b>Open git gui citool in a read-only mode</b>`git gui citool --nocommit`<br><b>Show a browser for the tree of a specific branch, opening the blame tool when clicking on the files</b>`git gui browser maint`


title: TLDR
content:
<b>Rotate the input image counter-clockwise for a specific degree</b>`pamflip [[-r|-rotate]][90|180|270] [path/to/input.pam] > [path/to/output.pam]`<br><b>Flip left for right</b>`pamflip [[-lr|-leftright]] [path/to/input.pam] > [path/to/output.pam]`<br><b>Flip top for bottom</b>`pamflip [[-tb|-topbottom]] [path/to/input.pam] > [path/to/output.pam]`<br><b>Flip the input image on the main diagonal</b>`pamflip [[-xy|-transpose]] [path/to/input.pam] > [path/to/output.pam]`


