Non-printing characters are stripped from program output. Use "cat -v" as part of the command pipeline if you want to see them.
So how do I use
cat -v if I want to see the colored output from:
watch ls -al --color
The right command is
It isn't documented in the man page or the --help screen. I has to use strings to find it.
|show 2 more comments|
I think it may not be possible with the 'watch' command. Here is a longer way of doing it:
You could put this in a script, for example:
To clarify, here's why I think it's not possible with the 'watch' command. See what happens if you use cat -v:
It shows you the color control characters...which I think is not what you want.