This one-liner prints out a series of spaces in white background, long enough to fill up entire terminal screen size:


printf "\e[47m%$((COLUMNS*LINES))s\e[0m";read

It might be required to use 256 color code, in case of the default white color isn’t actually pure white:


printf "\e[38;5;15m%$((COLUMNS*LINES))s\e[0m";read

I know some people do use mobile phone as light source in dark whenever is needed, and there seems to be some applications for phones. It is nothing special about this line or how it can be done on a computer or whatever devices if that really matters, but I do wonder how short of the code could it be?

This one, 43 characters or 48, in Bash. And I honestly don’t think I would need to take a screenshot of white image. Besides, on a blog with white background, I probably could just leave a few blank lines and tell you that there is your screenshot like the following screenshot:















screenshot of the terminal flashlight

Using something I learned a while back, which prints out a separator line. With a small change or two, it does the job. A long line with spaces, color code prefixed and reset in the end, then holding for Enter.

Let there be light!