agrep: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/agrep - from package: agrep

You may install the required package with command yum install {package}
Error in other languages:
agrep: bevel nie gevind nie
agrep: comandă negăsită
agrep: comando não encontrado
agrep: commande introuvable
agrep: command not found
agrep: käsku ei ole
agrep: không tìm thấy lệnh
agrep: komanda nerasta
agrep: Kommando nicht gefunden.
agrep: kommandot finns inte
agrep: komut yok
agrep: nie znaleziono polecenia
agrep: níor aimsíodh an t-ordú
agrep: no se encontró la orden
agrep: no s'ha trobat l'ordre
agrep: opdracht niet gevonden
agrep: parancs nem található
agrep: perintah tidak ditemukan
agrep: príkaz nenájdený
agrep: příkaz nenalezen
agrep: команда не найдена
agrep: командата не е открита
agrep: 命令找不到
agrep: コマンドが見つかりません