FG
💻 Software

Why is "less" much slower than "grep"?

Fresh7 days ago
Mar 15, 20264104 views
Confidence Score0%
0%

Problem

I sometimes have to look through files that are several gigs and have noticed that finding what I am looking for with grep is much faster than with less. Why could that be? I am talking about looking for a certain tag/word, not even any complicated regex.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Why is "less" much slower than "grep"?

Low Risk

By default, 'less' calculates line numbers, which can slow it down. Try using the '-n' option to suppress line number calculations and see if that speeds things up.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment