coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cat with -H option like grep


From: Bernhard Voelker
Subject: Re: cat with -H option like grep
Date: Fri, 20 Mar 2026 00:17:13 +0100
User-agent: Mozilla Thunderbird

On 3/19/26 20:26, Pádraig Brady wrote:
I do use this pattern quite a bit, but use grep '' to match everything.

E.g. grep -H --color '' /proc/sys/net/ipv4/*

I'm most often using '.' to match lines with content (which omits empty lines, 
obviously):
  ... | grep -Hn .

or just matching the line beginning, i.e. the caret '^' character:
  ... | grep -Hn ^

I agree that this doesn't warrant to add something in cat(1), and
to define a certain filter pattern with grep(1) is more flexible.

Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]