MMTARFILTER(1)

πŸ“¦
version 1.5.7 Β· 6 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’… 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 as dpkg, paths must be given as /path and 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 in seq
  • [!seq] matches any character not in seq

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-exclude pattern β€” exclude a path matching the given shell pattern. you can specify this option multiple times, stack 'em up. πŸ’…
  • --path-include pattern β€” re-include a pattern after a previous exclusion. also specifiable multiple times. it's giving "okay actually come back". πŸ’–
  • --pax-exclude pattern β€” exclude a pax header matching the given globbing pattern. yep, multiple times, go off. ✨
  • --pax-include pattern β€” re-include a pax header after a previous exclusion. multiple times, as always. πŸŽ€
  • --type-exclude type β€” 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, --xform EXPRESSION β€” use sed replace EXPRESSION to transform file names. multiple times, obviously. she's flexible. πŸ’œ
  • --strip-components NUMBER β€” strip NUMBER leading components from file names. 🌈
  • --idshift NUM β€” 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