grep - Binary file (standard input) matches

DECEMBER 14, 2020

문제

001 01

grep 명령어 시 “Binary file (standard input) matches” 에러 발생

원인

로그파일 grep 할때 텍스트 파일로 인식하지 않고 Binary file 로 인식

해결

-a 혹은 —text 옵션 추가

$ cat server.log | grep -E " \[[0-9]{4}\]" -a
or
$ cat server.log | grep -E " \[[0-9]{4}\]" --text

작업 기록 블로그