MSGGREP(1)
β¨ MSGGREP β the manual page, but make it cute β¨
okay bestie, so this is msggrep, it lives in the User Commands section of your manual (section 1, iykyk), and it's about to become your new obsession. buckle up. π
πΈ NAME πΈ
msggrep β pattern matching on message catalog π
π¦ SYNOPSIS π¦
msggrep [OPTION] [INPUTFILE]
π DESCRIPTION π
okay so basically? msggrep goes through a translation catalog and pulls out every single message that matches a pattern you give it, or that belongs to some source files you point at. it's giving "grep but for your PO files", and honestly? iconic.
Mandatory arguments to long options are mandatory for short options too. yes, the long ones and the short ones are a package deal, no cap.
π Input file location:
INPUTFILEβ this is your input PO file, the thing we're reading from, the main character.-D,--directory=DIRECTORYβ addsDIRECTORYto the list of places we search for input files. drop a whole folder in the group chat, we'll look there.
If no input file is given or if it is -, standard input is read. so if you're feeling mysterious and pipe-y, we'll read from stdin, periodt.
π Output file location:
-o,--output-file=FILEβ writes the output to the file you specify. put it somewhere nice.
The results are written to standard output if no output file is specified or if it is -. so no file? no problem, it just vibes straight to stdout.
π Message selection:
[-N SOURCEFILE]... [-M DOMAINNAME]... [-J MSGCTXT-PATTERN] [-K
MSGID-PATTERN] [-T MSGSTR-PATTERN] [-C COMMENT-PATTERN] [-X
EXTRACTED-COMMENT-PATTERN] [-W WORKFLOW-FLAG] [-S STICKY-FLAG]
A message is selected if it comes from one of the specified source files, or if it comes from one of the specified domains, or if -J is given and its context (msgctxt) matches MSGCTXT-PATTERN, or if -K is given and its key (msgid or msgid_plural) matches MSGID-PATTERN, or if -T is given and its translation (msgstr) matches MSGSTR-PATTERN, or if -C is given and the translator's comment matches COMMENT-PATTERN, or if -X is given and the extracted comment matches EXTRACTED-COMMENT-PATTERN, or if -W is given and its flags contain WORKFLOW-FLAG, or if -S is given and its flags contain STICKY-FLAG. like, any one of these? you're in. that's the vibe check. β
When more than one selection criterion is specified, the set of selected messages is the union of the selected messages of each criterion. translation: stack your criteria, and you get everyone who matched any of them. it's a group chat, not a private DM. π«Ά
MSGCTXT-PATTERN or MSGID-PATTERN or MSGSTR-PATTERN or COMMENT-PATTERN or EXTRACTED-COMMENT-PATTERN syntax:
[-E | -F] [-e PATTERN | -f FILE]...
*PATTERN*s are basic regular expressions by default, or extended regular expressions if -E is given, or fixed strings if -F is given. pick your fighter. βοΈ
-N,--location=SOURCEFILEβ selects messages extracted from SOURCEFILE. where'd you come from, bestie?-M,--domain=DOMAINNAMEβ selects messages belonging to domain DOMAINNAME. house rules.-J,--msgctxtβ start of patterns for themsgctxt. open the gates πͺ-K,--msgidβ start of patterns for themsgid. the key, the moment.-T,--msgstrβ start of patterns for themsgstr. the translation era.-C,--commentβ start of patterns for the translator's comment. notes app energy.-X,--extracted-commentβ start of patterns for the extracted comment. the comment that got pulled out.-E,--extended-regexpβ PATTERN is an extended regular expression. spicy regex unlocked π₯-F,--fixed-stringsβ PATTERN is a set of newline-separated strings. no regex tricks, just exact strings.-e,--regexp=PATTERNβ use PATTERN as a regular expression.-f,--file=FILEβ obtain PATTERN from FILE. patterns, but delivered by file π©-i,--ignore-caseβ ignore case distinctions.HELLOandhelloare the same girl.-W,--workflow-flag=FLAGβ select messages with FLAG.-S,--sticky-flag=FLAGβ select messages with FLAG. (sticky. like the note. yeah.)-v,--invert-matchβ output only the messages that do not match any selection criterion. the contrarian option, and we respect her.
π§ Input file syntax:
-P,--properties-inputβ input file is in Java.propertiessyntax.--stringtable-inputβ input file is in NeXTstep/GNUstep.stringssyntax.
π Output details:
--colorβ use colors and other text attributes always. always always. no restraint. π--color=WHENβ use colors and other text attributes if WHEN. WHEN may be'always','never','auto', or'html'.--style=STYLEFILEβ specify CSS style rule file for--color. dress her up π--no-escapeβ do not use C escapes in output (default).--escapeβ use C escapes in output, no extended chars.--force-poβ write PO file even if empty. an empty PO file is still a PO file, and we love her.--indentβ indented output style. aesthetics β¨--no-locationβ suppress'#: filename:line'lines. no receipts.-n,--add-locationβ preserve'#: filename:line'lines (default). receipts kept, bestie.--strictβ strict Uniforum output style.-p,--properties-outputβ write out a Java.propertiesfile.--stringtable-outputβ write out a NeXTstep/GNUstep.stringsfile.-w,--width=NUMBERβ set output page width. set your boundaries, queen.--no-wrapβ do not break long message lines, longer than the output page width, into several lines. let her run long, she's earned it.--sort-outputβ generate sorted output.--sort-by-fileβ sort output by file location.
β Informative output:
-h,--helpβ display this help and exit. hey, you need me? π-V,--versionβ output version information and exit. who am I? π«
π AUTHOR π
Written by Bruno Haible. thank you king π«‘
π REPORTING BUGS π
found a bug? don't suffer in silence, report it in the bug tracker at <https://savannah.gnu.org/projects/gettext> or by email to <bug-gettext@gnu.org>. they literally want to know.
π COPYRIGHT π
Copyright Β© 2001-2026 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. like, none. zero. protect yourself.
π SEE ALSO π
The full documentation for msggrep is maintained as a Texinfo manual. If the info and msggrep programs are properly installed at your site, the command
info msggrep
should give you access to the complete manual. go read her, she has lore π
ok that's the whole page bestie, no notes, you're so ready π«Ά
GNU gettext-tools 1.0 π January 2026 π and that's the msggrep(1) sign-off, mwah π
π¦ where this page comes from
- alpine 3.24: gettext-doc 1.0-r0 Β· GPL-3.0-or-later AND LGPL-2.1-or-later AND MIT
- arch rolling: gettext 1.0-2 Β· GFDL-1.2-only AND GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.0-only
- nixos 26.05: gettext 1.0
- nixpkgs unstable: gettext 1.0
- ubuntu stonking: gettext 1.0-3 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms