Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to flash the screen from the command line? I am looking for the same effect that Accessibility does for "Flash the screen when an alert sound occurs", but I don't want it for every alert.

share|improve this question

As far as I know, you can't replicate this alert without enabling that option. If you do enable that option, you can cause a flash from Terminal using:

osascript -e "beep"

However, if you don't want to enable that option, you can use invert colours. Using the invert colours Accessibility option twice causes the screen to flash, therefore pressing the keyboard shortcut ⌃⌥⌘8 twice will cause a flash:

tell application "System Events" to repeat 2 times
key code 28 using {command down, control down, option down}
delay 0
end repeat
share|improve this answer
The invert is a good alternative. Thanks. – studgeek Apr 13 '14 at 2:17

It doesn't flash the whole screen (unless you have terminal set to full screen) but if you go to Preferences > Settings > Advanced and select "Visual Bell" you can then type:

echo ^G

(The keystrokes to get the correct characters are: echo control + v control + g because the control character has to be quoted)

to flash the terminal window.

share|improve this answer
Whilst this works, the effect is very subtle on my default Terminal profile. – grgarside Apr 11 '14 at 16:34

For others, one alternative I have found is to use this screenbrightness command line tool ( like so. It only works on the main display though:

screenbrightness 0; sleep 1; screenbrightness 1
share|improve this answer
something is missing ? – Buscar웃 Apr 11 '14 at 17:25
What is missing @Buscar? – studgeek May 9 '14 at 16:52
I tired it, and it does not work on my MBA 10.9.2 Error -bash: screenbrightness: command not found – Buscar웃 May 9 '14 at 17:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.