2

Below is the tail statement:

tail -4 FDECMP1_$$.log

I need to print the last 4 lines of file FDECMP1_$$.log in Red.

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
Ashish P
  • 21
  • 2

2 Answers2

2

This command will do the job:

printf "%s" $(printf '\033[0;31m');tail -4 FDECMP1_$$.log
Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
galoget
  • 349
0

As @galoget showed, you can use the ANSI escape sequences to change the coloring of shell texts.

This answer has more information on this and a nice xterm-256-color-chart to conveniently find the correct color for your purposes.

Stefan M
  • 1,616
  • 1
    Why answer the question again when it is already answered? In these cases, please add a comment to the existing answer, instead. – Ned64 Feb 14 '18 at 08:36