egrep command not found

In this troubleshooting guide we learn how to fix egrep command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

egrep: command not found

or when using sudo you get the following error message

sudo: egrep: command not found

Solutions to egrep: command not found

How To Fix egrep: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu egrep is provided by grep package.

grep is:

‘grep’ is a utility to search for text in files; it can be used from the command line or in scripts. Even if you don’t want to use it, other packages on your system probably will.

The GNU family of grep utilities may be the “fastest grep in the west”. GNU grep is based on a fast lazy-state deterministic matcher (about twice as fast as stock Unix egrep) hybridized with a Boyer-Moore-Gosper search for a fixed string that eliminates impossible text from being considered by the full regexp matcher without necessarily having to look at every character. The result is typically many times faster than Unix grep or egrep. (Regular expressions containing backreferencing will run more slowly, however.)

To fix this problem, we can install more using the command below.

sudo apt-get -y install grep

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install grep.

sudo apt -y install grep

Or if you have aptitude installed you can use the following command.

sudo aptitude install grep

Summary

In this tutorial we learn how to fix egrep command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.