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 -v is 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 -p but 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 🌸
  • -m max β€” 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, -q or -v is specified πŸ¦‹
  • -p β€” Print the filename, the header and the matching line for each of the matched msgs. if -o is specified, each match is printed instead of the matching line. this option is ignored if -c, -q or -v is 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:

  • 0 on success ✨
  • 1 if no match was found 😭
  • >1 if 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 πŸ¦‹βœ¨