g.filename: 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.filename - 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.filename - from package: grass-core

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