g.tempfile: 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/lib64/grass-6.4.4/bin/g.tempfile - from package: grass

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

On Debian possible default full paths are:

/usr/lib/grass64/bin/g.tempfile - from package: grass-core

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