Guest User

Untitled

a guest
Aug 16th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. tail -f /var/log/file1 -f /var/log/file2
  2.  
  3. tail -f /var/log/file1 | grep '(pattern1|pattern2)'
  4.  
  5. tail -f /var/log/file2 | grep '(pattern3|pattern4|pattern5)'
  6.  
  7. RED='33[0;31m'
  8. BLUE='33[0;34m'
  9.  
  10. tail -fn0 /var/log/file1 | while read line;
  11. do
  12. if echo $line | grep -q '(pattern1|pattern2)';then
  13. echo -e "{$RED}$line"
  14. fi
  15. done
Advertisement
Add Comment
Please, Sign In to add comment