QSGREP(1)
π 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-$9are substituted by the submatches of the regular expression. so like, you write a little format string and$0through$9get 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
- epel 9: mod_qos 11.74-1.el9 Β· GPLv2
- ubuntu noble: libapache2-mod-qos 11.74-1build3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms