MAGREP(1)
π MAGREP(1) π
okay bestie, welcome to the magrep manual page, section 1 of the General Commands Manual β yes it's a real grown-up manpage, but we're doing this my way π
β¨ NAME β¨
magrep β search messages matching a pattern ππ
πΈ SYNOPSIS πΈ
magrep [-c | -h | -o | -p | -q | -m max] [-v] [-i] [-l] [-a | -d]
header:regex [msgs ...]
π¦ DESCRIPTION π¦
so like, magrep prints the names of files from the msgs you gave it, but only when the value of header matches the POSIX Extended Regular Expression regex. that's the whole vibe π
(and if you're wondering about the message argument syntax, go peek at mmsg(7) β she explains it all β¨)
If header is empty, then magrep matches against the maildir flags of msgs. no cap.
If header is '*', magrep searches for the pattern in any header. iconic behaviour honestly π
If header is '/', magrep searches any plain text parts of the msgs body. like it goes digging in the actual message text, slay π§
If no msgs are specified and magrep is used interactively, the current sequence will be searched. periodt.
The options are as follows, and yes I'm listing every single one because we don't skip π
-aβ Search for regex in RFC 2822 address header parts only. just the address bits, nothing else π«Ά-cβ Only print a count of matching headers. and if-vis specified, count the non-matching headers instead. flip the script β¨-dβ Decode the header according to RFC 2047 prior to searching. yes bestie, decode first, then search π₯-hβ Like-pbut do not print the file name. lowkey shy about filenames π-iβ Match regex case insensitively. UPPERCASE, lowercase, we don't care π-lβ Only search a message until a match has been found. stop the second you find one, we're efficient πΈ-mmax β Do not show more than max matches. cap it, bestie π-oβ Print each match only, not the entire line. this option is ignored if-c,-qor-vis specified π¦-pβ Print the filename, the header and the matching line for each of the matched msgs. if-ois specified, each match is printed instead of the matching line. this option is ignored if-c,-qor-vis specified β¨-qβ Quiet mode: do not print anything, quit as soon as possible. silent but deadly, main character energy π-vβ Invert the match; print (or count) all files where regex does not match. yes, the opposite, we love a plot twist π
π EXIT STATUS π
The magrep utility exits:
0on success β¨1if no match was found π>1if an error occurs π
π SEE ALSO π
grep(1), mmsg(7), regex(7) / re_format(7) π
π AUTHORS π
Leah Neukirchen <leah@vuxu.org> β thank you for this gift, legend π«Ά
β TRIVIA β
magrep is not called mgrep because many tools with this name already exist. the lore is real, iykyk π
π§ LICENSE π§
magrep is in the public domain. π₯
To the extent possible under law, the creator of this work has waived all copyright and related or neighboring rights to this work. πΈ
http://creativecommons.org/publicdomain/zero/1.0/
and that's the whole page bestie, you're officially a magrep expert now, no cap π
Debian Β· September 10, 2018 Β· MAGREP(1) β mwah, love u, go grep some messages π¦β¨
π¦ where this page comes from
- alpine 3.24: mblaze-doc 1.4-r0 Β· CC0-1.0
- debian bookworm: mblaze 1.1-1 Β· CC0-1.0
- debian trixie: mblaze 1.1-1 Β· CC0-1.0
- nixos 26.05: mblaze 1.4
- nixpkgs unstable: mblaze 1.4
- ubuntu jammy: mblaze 1.1-1 Β· CC0-1.0
- ubuntu noble: mblaze 1.1-1 Β· CC0-1.0
- ubuntu resolute: mblaze 1.1-1build1 Β· CC0-1.0
- ubuntu stonking: mblaze 1.1-1build1 Β· CC0-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms