DEV Community

y4u
y4u

Posted on

grep, uniq -c and sed in a GUI — and the Parts That Don't Map (a CLI Cheat Sheet)

Past about 50 GB there is almost nothing left to compare against among GUI apps, so the tools I actually compete with are CLI ones. Over the last few releases I brought grep's ideas into my huge-file viewer one at a time — -v, -w, then uniq -c. They all shipped in v1.5.0, so here's one page of what maps across, and what doesn't.

Short version: I can honestly claim grep, uniq -c and sed. Not awk.

Finding

CLI UwView Pro
grep PATTERN search (stage 1)
grep -i / -E / -w / -v Ignore case / Regex / Whole word / Exclude checkboxes
grep -C N ±N lines of context
`grep A \ grep B \
{% raw %}wc -l total line count, shown the moment the file opens

Counting

CLI UwView Pro
`\ sort \
{% raw %}`\ head -20`
(getting back from counts to lines) click a ranking row → drill into that value

Fixing and keeping

CLI UwView Pro
sed -i 's/A/B/g' replace-all — the original is never rewritten; edits go to a .ewvz sidecar
grep ... > hits.txt export hit lines (numbers, header row, ±N context)
zgrep PATTERN log.gz search a .uwvz archive without unpacking

Close behavior, not strict equivalence: drill-down refines ±N-line context blocks while a pipe streams lines, so edge cases differ.

Measured, all on the same 48 GB / 892,239,125-line file

  • Search: 54.7 s first run (while indexing), ~14 s after. grep 64.64 s, ripgrep 71.49 s — every time
  • Three -v stages: 10,967 → 10,949 → 10,928 → 16
  • Tally: 10,967 hits → 159 distinct in 22 ms; 61.5 s over 1.39M hits
  • Replace-all: 47.0 s for two replaces. Quitting mid-work: 0 s

I also ran this whole table against the CLI

Those are per-operation numbers. I then ran the exact workflow this table describes end to end — once on the CLI, once in the GUI — against a 258 GB, 4,509,830,821-line file: five searches, a four-stage drill-down, a tally, a replace-all and a save.

CLI 51 m 17 s against 12 m 29 s in the GUI. But with a single question ripgrep wins; the crossover is at question two. Write-up with all the numbers and six cross-checks: https://uvp.y42u.net/en/blog/uvp-258gb-cli-vs-gui-en/

What does NOT map — the more useful half

  • awk '{s+=$3} END{print s}' — no sums, averages or arithmetic. Tally stops at frequency ranking. awk is field splitting, arithmetic, conditions, BEGIN/END and printf; Tally's lineage is grep -oE | sort | uniq -c. Being vague here would just produce "I thought it could sum a column"
  • tail -f — not in Pro; it lives in the free edition
  • cut / paste / join — not available (block copy exists)
  • Pipes, redirection, scripting — not available. Automation and cron stay CLI territory

When to use which

CLI wins for a one-off search, anything scripted, anything on a schedule, anything piped onward. The GUI earns its place when you don't yet know what to throw away — when one file gets many different questions. At 48 GB each new question costs another full scan, 64 s at a time; index once and repeats take ~14 s, with every stage still there as a tab. On the 258 GB run the crossover has an exact value: a 317.8 s index plus 32.38 s per question, against ripgrep's 277.91 s per question, breaks even at question 1.29.

Full tables and conditions: https://uvp.y42u.net/en/blog/uvp-cli-to-gui-map-en/

UwView Pro is on sale (Windows, macOS, Linux — one license covers all three; 14-day free trial — editing features included).

Top comments (0)