[Linux] tail grep -E 두 단어 검색하기


[Linux] tail grep -E 두 단어 검색하기

tail은 로그를 실시간으로 확인할 때 유용한 명령어 입니다. 저와 많은 사람들이 아마 tail -f 명령어를 주로 사용하며 서비스를 모니터링 할 것 입니다. 오늘은 tail 명령어를 사용할 때 특정 단어가 나올 때만 로깅이 출력되도록 보는 방법에 대해서 알아보겠습니다. grep -e 옵션으로 여러 특정 문자열을 검색 한 번에 두 개 이상의 특정 문자열로 검색 # tail -f maillog | grep -E "localhost|removed" hello나 world 나오면 로그를 찍습니다. # tail -f maillog |egrep "localhost|removed" grep -E 는 egrep 과 동일합니다. # tail -f maillog |grep -e "localhost" -e "removed..


원문링크 : [Linux] tail grep -E 두 단어 검색하기