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

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

On Debian possible default full paths are:

/usr/bin/legend - from package: mapserver-bin

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