PTARGREP(1)
๐ PTARGREP โ bestie, it's the perl programmers reference guide era
okay so real quick: this whole page lives in the Perl Programmers Reference Guide section 1, and we're gonna get into it ๐ซถ
โจ NAME โจ
ptargrep โ literally the tool that applies pattern matching to the contents of files inside a tar archive. no cap, that's the whole vibe.
๐ธ SYNOPSIS ๐ธ
ptargrep [options] <pattern> <tar file> ...
and the options, bestie, laid out for you:
--basename|-b ignore directory paths from archive
--ignore-case|-i do case-insensitive pattern matching
--list-only|-l list matching filenames rather than extracting matches
--verbose|-v write debugging message to STDERR
--help|-? detailed help message
copy that exactly, i don't make the rules ๐
๐ฆ DESCRIPTION ๐ฆ
so this utility lets you apply pattern matching to the contents of the files tucked inside a tar archive. it's giving "i need to know which files in this archive have lines matching my pattern." you might use it to identify all the files in an archive containing lines that match your specified pattern and then either print out the pathnames or extract the files. two moods, same icon โจ
heads up: the pattern is used as a Perl regular expression โ as opposed to a simple grep regex. so yes, you have powers now, use them responsibly ๐ง
also you can pass multiple tar archive filenames and they'll each be processed in turn. one after another, no skipping, we go in order ๐
๐ OPTIONS ๐
--basename(alias-b) โ when matching files get extracted, ignore the directory path from the archive and write to the current directory using the basename of the file from the archive. > โ ๏ธ beware: if two matching files in the archive have the same basename, the second file extracted will overwrite the first. ๐ญ like, gone. poof. consider yourself warned bestie.--ignore-case(alias-i) โ makes pattern matching case-insensitive.Hello,hello,HELLOโ all of them slay equally ๐--list-only(alias-l) โ prints the pathname of each matching file from the archive toSTDOUT. without this option, the default behaviour is to extract each matching file. so like, if you don't say-l, it's actually pulling files out. just so you know ๐--verbose(alias-v) โ logs debugging info toSTDERR. not the same stream as your results, iykyk ๐--help(alias-?) โ displays this documentation. the classic. the icon.-?is such a main character flag honestly ๐
๐ COPYRIGHT ๐
Copyright 2010 Grant McLean <grantm@cpan.org>
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie โ no crumbs left behind ๐
sign-off szn: this gorgeous little number comes from perl v5.42.3, dated 2026-11-03, and it's filed under PTARGREP(1) ๐
๐ฆ where this page comes from
- alpine 3.24: perl-doc 5.42.3-r0 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms