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 to STDOUT. 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 to STDERR. 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 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