Say you’ve got a shell script which outputs a bunch of text with some parts colored, such as a regression testing system that colors failures in red and passes in green. The output from this is too big for one screen, so you pipe it through less, which strips away the colors.

What you want here is the -r flag, like so:

less -r

In short, this stops less from stripping away raw characters which are used to add the coloring.