I have a debian install that runs an application server.

I ssh into this debian install from a Windows computer using cygwin and with the application server running I use tail -f to monitor the log files.

Errors from the application are printed in red, warning in yellow, and all other output is the console text color.

However, when I run a nearly identical application server in Windows, and use cygwin to print the log from the filesystem, the log is not colored the way it is when ssh'd into debian.

Is this a difference in the tail command installed in debian and in cygwin? How can I emulate this behavior in cygwin?

  • Which terminal emulator are you using in these 2 cases? Putty, Windows cmd.exe, Windows powershell? – Mark Plotnick Apr 8 '16 at 6:39
  • I'm using the cygwin prompt. – Mars Apr 8 '16 at 18:54

tail is capable to visualize colors if the source is providing the correct escape codes. Eg:

ls --color=always |tail -f

Likely the Windows logs are not providing them. You can check with

$ od -c logfile

$ ls --color=always |od -c 
0000000 033   [   0   m 033   [   0   1   ; 3   2   m   a   .   e   x 
0000020 e 033   [   0   m  \n   A   0   2  _   C   a   m   p   _   d

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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