How can I dim the screen from Terminal? Is it possible to dim the screen from Terminal, in a Mac with OS X Lion? Is there any command to do control brightness and volume?
You can install this command line tool from github.com/nriley/brightness. The install is pretty easy if you have homebrew:

brew install brightness


And usage is straightforward:


Set 100% brightness: brightness 1
Set 50% brightness:
brightness 0.5


Unfortunately it doesn't work for external monitors. See Does Apple support DDC/CI for  3rd party displays via Apple&#39;s Thunderbolt to DVI adapter for background on why.