Extract to the current directory using the basename of the file from the archive

ptargrep

  • Find regular expression patterns in one or more tar archive files.
    More information: <https://manned.org/ptargrep>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

ptargrep --basename "{{search_pattern}}" {{path/to/file}}

click the source code to copy install ptargrep on any operating system with command-not-found.com