QSGREP(1)

πŸ“¦
version 11.74 Β· 2 versions
, in epel 9, ubuntu noble

πŸ’– QSGREP β€” the qsgrep(1) man page, but make it cute πŸ’–

okay bestie, sit down, hydrate, and let me tell you about qsgrep β€” she's a lil command-line baddie from the mod_qos utilities that prints matching patterns within a file. no cap. she's giving detective but make it regex πŸ•΅οΈβ™€οΈβœ¨


🌸 NAME 🌸

qsgrep β€” prints matching patterns within a file. that's it. that's the whole job. and she does it flawlessly, periodt. πŸ’…


✨ SYNOPSIS ✨

qsgrep -e <pattern> -o <sub string> [<path>]

yes, -e and -o are the mandatory duo, [<path>] is optional because she's flexible like that. πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

so qsgrep is a simple tool to search patterns within files. simple?? she's humble, let her be humble. 🫢

she uses regular expressions to find patterns, and then prints the submatches within a pre-defined format string. that's the whole glow-up: find the thing, pull out the pieces you actually care about, and print them exactly how you told her to. main character energy, honestly. πŸ‘‘


πŸ”₯ OPTIONS πŸ”₯

  • -e <pattern> β€” Specifies the search pattern. this is the thing you're hunting for, and yes she's using regular expressions so you can go feral with it. go off. 🌈
  • -o <string> β€” Defines the output string where $0-$9 are substituted by the submatches of the regular expression. so like, you write a little format string and $0 through $9 get swapped in with the captured groups. iconic behaviour fr fr. πŸ’–
  • <path> β€” Defines the input file to process. qsgrep reads from standard input if this parameter is omitted. so if you don't hand her a file, she'll happily slurp from stdin like the adaptable queen she is. 😌

πŸ“ EXAMPLE πŸ“

Shows the IP addresses of clients causing mod_qos(031) messages): πŸ‘€

qsgrep -e 'mod_qos\(031\).*, c=([a-zA-Z0-9:.]*)' -o 'ip=$1' error_log

see what she did there?? grabbed the capture group with $1 and printed ip= in front of it. ate. no crumbs. πŸ’…βœ¨


πŸ¦‹ SEE ALSO πŸ¦‹

qsdt(1), qsexec(1), qsfilter2(1), qsgeo(1), qshead(1), qslog(1), qslogger(1), qspng(1), qsre(1), qsrespeed(1), qsrotate(1), qssign(1), qstail(1)

the whole friend group πŸ’œ go say hi, they're all part of the same mod_qos utilities clique.


πŸ‘‘ AUTHOR πŸ‘‘

Pascal Buchbinder, http://mod-qos.sourceforge.net/

(not me being obsessed with a man page author credit but like… respect where respect is due 🫢)


🧚 SIGN-OFF 🧚

and that's the whole page, bestie!! this lil gem is from the mod_qos utilities, version 11.74, dated May 2023. she's a classic, she's reliable, and she will grep your patterns with style. πŸ’–βœ¨πŸŽ€πŸ¦‹

mwah, go search something. πŸ˜­πŸ’…

πŸ“¦ where this page comes from