initdb: 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/initdb - from package: postgresql-server

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/lib/postgresql/9.4/bin/initdb - from package: postgresql-9.4

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