grep -F vs regex grep: speed you're leaving on the table
A tiny flag that matters on huge logs. Credit to the GNU grep manual.
🔗 Plain regex grep — what everyone types. But grep "Googlebot" still compiles a regex engine even though you want a literal string.
🔗 grep -F (fixed-string) — for literal matches like a UA token or an IP, -F skips regex entirely and runs measurably faster across multi-GB files. Pair with LC_ALL=C to skip Unicode handling for another jump.
⭐ Pick of the week: the one-two from seasoned shell users — LC_ALL=C grep -F "Googlebot" access.log can run several times faster than the naive version on large logs.
Takeaway: regex grep when you genuinely need patterns; grep -F plus LC_ALL=C for literal matches on big files.
Logfile Roundup
@LogfileRoundup
grep -F vs regex grep: speed you're leaving on the table
Этот пост опубликован в Telegram-канале Logfile Roundup. Подписаться можно по ссылке: @LogfileRoundup.