PTARGREP(1perl)
π PTARGREP π
okay bestie, so this is ptargrep from the Perl Programmers Reference Guide β it's the lil tool that does pattern matching inside tar archives and honestly? it's giving main character energy for anyone who's ever had to dig through a .tar file looking for one tiny string. π«Ά
β¨ NAME β¨
ptargrep β apply pattern matching to the contents of files in a tar archive π
πΈ SYNOPSIS πΈ
ptargrep [options] <pattern> <tar file> ...
Options:
--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
π¦ DESCRIPTION π¦
So like, this utility lets you apply pattern matching to the contents of files contained in a tar archive. Periodt. You might use it to identify all files in an archive which contain lines matching the specified pattern, and then either print out the pathnames or extract the files. It's giving "search but make it tar-aware." π₯
The pattern will be used as a Perl regular expression (as opposed to a simple grep regex) β so yes, you get the full Perl regex glow-up, not the basic version. iykyk. π
Multiple tar archive filenames can be specified β they will each be processed in turn. No cap, you can just stack 'em up. π
π OPTIONS π
--basename(alias-b) β When matching files are 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. π not the overwrite jump scare fr fr--ignore-case(alias-i) β Make pattern matching case-insensitive. Slay, nowFOOandfooare the same vibe. π--list-only(alias-l) β Print the pathname of each matching file from the archive toSTDOUT. Without this option, the default behaviour is to extract each matching file. So basically: look but don't touch mode. π--verbose(alias-v) β Log debugging info toSTDERR. She's chatty and we love that for her. π--help(alias-?) β Display this documentation. The classic cry for help, but make it documentation. π
π 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.
bestie, quick reminder: this whole thing ships as perl v5.44.0, dated 2026-10-17. go forth and grep those tarballs, icon. β¨πΈπ
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms