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

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

On Debian possible default full paths are:

/usr/lib/gmt/bin/nearneighbor - from package: GMT

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