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 β€” adds DIRECTORY to 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 the msgctxt. open the gates πŸšͺ
  • -K, --msgid β€” start of patterns for the msgid. the key, the moment.
  • -T, --msgstr β€” start of patterns for the msgstr. 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. HELLO and hello are 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 .properties syntax.
  • --stringtable-input β€” input file is in NeXTstep/GNUstep .strings syntax.

πŸ’œ 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 .properties file.
  • --stringtable-output β€” write out a NeXTstep/GNUstep .strings file.
  • -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 Β© 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