In plain tail command you you actually need to scan the whole log to get to error. So I was looking to color code tail and guess what it is pretty easy to do by using perl.
tail -n 1000 -f file name | perl -pe 's/.*Exception.*/\e[0;31;33m$&\e[0m/g'
This is so cool and this thing goes to .bashrc so now I have baretail like visually appealing tail :)
No comments:
Post a Comment