Explain grep code

Paste grep commands and Vibe explains what each one finds: what the flags change, what the pattern matches and what the command prints back.

find-problems.sh

Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.

Vibe20 lines selected

Press Explain it for the sample, or paste your own code first.

What this grep sample shows

-i and -n
grep prints every line that contains the pattern. -i ignores case and -n adds line numbers: on a test log it printed 2:09:00:05 ERROR could not reach database and 5:09:02:30 Error: disk almost full.
-c and -w
-c prints how many lines matched instead of the lines: 2 for timeout. -w only matches the whole word, so -w "fail" printed only WARN fail count 3 and skipped the lines with failed and failure.
-v, -r and -l
-v turns the search around and prints the lines that don't match: the access log came back without its two health checks. -r searches every file in a folder and its subfolders, and -l prints only the names of files with a match: src/cart.js and src/lib/retry.py, but not src/price.js.
-o and -E
-E allows extended patterns such as {2} for exactly two, and -o prints only the matched part. [45][0-9]{2} is a 4 or 5 followed by two digits, so the command printed 500 and 404 and left out the 200s.

Good to know

  • Run with GNU grep 3.12 on a test log, access log and source folder.
  • grep's exit code says what happened: 0 when something matched, 1 when nothing did, and 2 for an error such as nope.log: No such file or directory.
  • In a script with set -e, a search that finds nothing ends the script. grep -c "panic" printed 0, exited with 1, and the next line never ran.

Watch out: A . in the pattern matches any character, not just a dot. grep "10.0.0.5" also matched a line with 10a0b0c5. Use grep -F to search for the text exactly as written, or write \. for a dot.

Explain grep code beside your editor

Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).

Install on Mac

curl -fsSL https://unvibe.site/install.sh | bash

Paste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.

Opening the .dmg the first time
  1. Open the .dmg and drag Unvibe to Applications.
  2. Open it once; macOS says it can't verify it. Click Done.
    macOS dialog: Unvibe Not Opened, with Done and Move to Trash
    Real screen, macOS 15
  3. System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.
    macOS Privacy & Security, Security section: Unvibe was blocked to protect your Mac, with the Open Anyway button
    Real screen, macOS 15

The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open