Which variants of grep are deprecated?

CaffeineAddict

Well-Known Member
Joined
Jan 21, 2024
Messages
641
Reaction score
404
Credits
5,332
I know fgrep and egrep are deprecated because same functionality exists with grep -E and grep -F

But what about pgrep and rgrep? are these 2 deprecated as well?
For rgrep there is grep -r but I don't find any mention of rgrep being deprecated.

pgrep seems unique and still valid, so it's not deprecated right?.
Are there also other variants of grep?
 


I wouldnt say deprecated, I still use egep for example.

By the time it doesn't show up on Debian anymore you can "move on". Till then I think with such tiny tools its safe to ignore deprecation warnings and just use it till it disappears.

That being said, using grep with options instead of, say, egrep, seems more elegant to me. imho ofc.

Where did you read egrep is deprecated?
 
Where did you read egrep is deprecated?
quote from link below:
Direct invocation as either egrep or fgrep is deprecated,but is provided to allow historical applications that rely on them to run unmodified

See also here:

Although the answer from SO, is not clear, because linked article doesn't say anything about rgrep being deprecated.
 
I know fgrep and egrep are deprecated because same functionality exists with grep -E and grep -F

But what about pgrep and rgrep? are these 2 deprecated as well?
For rgrep there is grep -r but I don't find any mention of rgrep being deprecated.

pgrep seems unique and still valid, so it's not deprecated right?.
Are there also other variants of grep?

egrep and fgrep have supposedly been deprecated for a long time. But as it says, they’ve been kept to allow older scripts to function without modification. But nothing says that they’re going to be removed any time soon either. And if they do ever get removed, I imagine that people will just create aliases for them.
I haven't seen anything mentioned about rgrep being deprecated.

Also. pgrep isn’t part of the grep package. It has nothing to do with grep. It's a separate tool altogether. It’s actually part of the procps package, which also contains things like ps, free, skill, pkill, snice, tload, top, uptime, vmstat, watch, w, pdwx etc.

pgrep allows you to use regular expressions to search for running processes.

And yes, there are variants of grep. At the moment the two main ones are GNU grep (on Linux, Cygwin etc) and BSD grep (bsdgrep) - used on BSD and Apple Macs/iMacs.
.
There are other grep implementations like freegrep, which is licensed under the BSD licence. And there are also older versions that were made for various Unix implementations.

Also, toolkits like busybox, toybox, the heirloom project, suckless software's 9base provide non-GNU versions of traditional Unix commands.

Busybox, and 9base are licensed under the GPL, but they are not part of the GNU project.
Busybox contains more minimalist, stripped down, non-GNU versions of the standard Unix tools.
9base contains versions ported from the old Plan9 OS.
Toybox is distributed under the BSD license and contains stripped down, POSIX compliant versions of the standard tools.
And the heirloom project provides tools that have been derived from older Unix implementations, using the original algorithms.

Most Linux distributions use GNU grep and the GNU userland tools. But some distributions like Alpine Linux use the busybox versions of the standard Unix tools. So grep on those machines will be the busybox version of grep.

The GNU version of grep and the other userland tools are complete versions of the original tools, but many of them feature extensions, providing them with additional capabilities that earlier implementations did not have. Some people see the extra functionality as bloat and prefer to use more minimal implementations of the standard tools, like busybox. Others don't like the GPL, so they use BSD licensed implementations like toybox. And as mentioned BSD and Mac people use the BSD versions of the userland tools.

So yeah.... Lot's of variants of grep (and the other standard CLI tools)
 
Last edited:
@JasKinasis
Thank you for detailed description, this is more than what I could google out myself!

I haven't seen anything mentioned about rgrep being deprecated.
With everything else being clear, now I'll need to investigate which of the 2 grep -r and rgrep provide more options or functionalities to be able to declare rgrep not required to use even if not explicitly deprecated.

And if they do ever get removed, I imagine that people will just create aliases for them.
It's funny but true, I called them lazy admins lol
I couldn't sleep well knowing there is a deprecated line in my script.
 


Top