testdisk: 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/testdisk - from package: testdisk

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

On Debian possible default full paths are:

/usr/bin/testdisk - from package: testdisk

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