grep 실무 명령어
이것만 알아도 중급
$ cd /app
------------------------------------------------------------------------------------------------------
$ grep -rI --include="*.conf" "찾을단어 or 문장" /app
-r : /app 하위 전체 디렉토리
-I : binary file 제외
--include : *.conf 파일만 검색
------------------------------------------------------------------------------------------------------
$ grep -rI --include="*.conf_*" --include="*.conf.*" "찾을단어 or 문장" /app
-r : /app 하위 전체 디렉토리
-I : binary file 제외
--include : *.log_*, *.log.* 여러개 파일만 검색
================================================================
$ grep -rI --exclude="*.conf" "찾을단어 or 문장" /app/tomcat
-r : /app/tomcat 하위 전체 디렉토리
-I : binary file 제외
--exclude : *.conf 파일 제외
------------------------------------------------------------------------------------------------------
$ grep -rI --exclude="*.log_*" --exclude="*.log.*" "찾을단어 or 문장" /etc/httpd
-r :/etc/httpd 하위 전체 디렉토리
-I : binary file 제외
--exclude : *.log_*, *.log.* 파일 제외
------------------------------------------------------------------------------------------------------
|