Map keyboard key to unix command
You could use a tool like Keyboard Maestro but it might be a bit overkill. 

If you just want to execute a command in Terminal and close the window again:


Put command in a shell script
Make it executable (chmod +x ...)
Move shell script to a convenient place (e.g. our Desktop)
run shell script/command by double click