MMTARFILTER(1)
π MMTARFILTER β the manual page, but make it make sense π
okay bestie, this is mmtarfilter from the User Commands section of the manual, and honestly? it's giving "quiet little tool that does five whole jobs" and I'm obsessed. let's get into it π«Ά
β¨ NAME β¨
mmtarfilter β filter a tarball like dpkg does
like. exactly like dpkg does. that's the whole pitch. πΈ
π DESCRIPTION π
first things first, here's the usage line, verbatim, no notes:
usage: mmtarfilter [-h] [--path-exclude pattern] [--path-include
pattern]
[--pax-exclude pattern] [--pax-include pattern] [--type-exclude
type] [--transform EXPRESSION] [--strip-components NUMBER]
[--idshift NUM]
so what's actually happening here? π¦
Job one: it filters a tarball coming in on standard input using the exact same rules as the dpkg --path-exclude and --path-include options, then writes the resulting tarball out to standard output. if you wanna know how those two dpkg options work in detail, go read dpkg(1) β that's where the lore lives.
β οΈ super important, do not skip this: to reuse the exact same semantics asdpkg, paths must be given as/pathand not as./path, even if they happen to be stored that way inside the tarball. the tarball does not care about your feelings. π
Job two: it filters out unwanted pax extended headers with --pax-exclude and --pax-include. this is genuinely so useful when a tool only accepts certain xattr prefixes. for example, tar2sqfs only supports SCHILY.xattr.user.*, SCHILY.xattr.trusted.* and SCHILY.xattr.security.* β but not SCHILY.xattr.system.posix_acl_default.*. so like, if that's your situation, this flag is your bestie fr fr. π
fun fact: both types of those options use Unix shell-style wildcards, and here's the whole legend:
*matches everything?matches any single character[seq]matches any character inseq[!seq]matches any character not inseq
Job three: filter out files matching a specific tar archive member type with --type-exclude. the valid type names are REGTYPE (regular file), LNKTYPE (hardlink), SYMTYPE (symlink), CHRTYPE (character special), BLKTYPE (block special), DIRTYPE (directory), FIFOTYPE (fifo) β or you can just use their tar format flag value (0-6, respectively). iconic shorthand, we love her. π
Job four: transform the path of tar members using a sed expression, exactly like with GNU tar's --transform. β¨
Job five: strip leading directory components off of tar members. just like GNU tar --strip-components, tar members that have less or equal components in their path are not passed through. no cap, they just don't make it. π¦
and lastly: shift the user id and group id of each entry by whatever value you hand to the --idshift argument. heads up though β the resulting uid or gid must not be negative. do not try it. the vibes will be bad. π
π§ options: π§
-h,--helpβ show this help message and exit. the classic. the GOAT. π--path-excludepattern β exclude a path matching the given shell pattern. you can specify this option multiple times, stack 'em up. π--path-includepattern β re-include a pattern after a previous exclusion. also specifiable multiple times. it's giving "okay actually come back". π--pax-excludepattern β exclude a pax header matching the given globbing pattern. yep, multiple times, go off. β¨--pax-includepattern β re-include a pax header after a previous exclusion. multiple times, as always. π--type-excludetype β exclude certain member types by their type. choose types either by their name (REGTYPE,LNKTYPE,SYMTYPE,CHRTYPE,BLKTYPE,DIRTYPE,FIFOTYPE) or by their tar format flag values (0-6, respectively). and yes, this one can be specified multiple times too. π₯--transform,--xformEXPRESSION β usesedreplace EXPRESSION to transform file names. multiple times, obviously. she's flexible. π--strip-componentsNUMBER β strip NUMBER leading components from file names. π--idshiftNUM β integer value by which to shift the uid and gid of each entry. β
and that's the whole page, bestie β go filter something and feel powerful about it. π«Ά
this has been mmtarfilter 1.5.7, from August 2025, and that's the vibe check, periodt. ππ
π¦ where this page comes from
- debian trixie: mmdebstrap 1.5.7-1+deb13u1 Β· MIT
- ubuntu resolute: mmdebstrap 1.5.7-3 Β· MIT
- ubuntu stonking: mmdebstrap 1.5.7-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms