$shutdown -p now
command line not enough to close Mac box. It doesn't turn the machine off.
After some googlings, I founded this The Command Line Junkie's Guide To Mac OS X,
which tell me that I can shut it down with command :
osascript -e 'tell application "Finder" to shut down'