find로 파일 내용을 검색하고 싶으면 아래와 같이 하면 된다.
find /path -name "*.php" | xargs grep pattern
예를 들면 아래와 같이 하면 된다.
find /path -name "*.php" | xargs grep pattern
예를 들면 아래와 같이 하면 된다.
$ find ./ -name "*.php" | xargs grep "lang->cmd_modify = '수정'"
./common/lang/ko.lang.php: $lang->cmd_modify = '수정';
$ find ./ -name "*.php" | xargs grep "수정"
./common/lang/ko.lang.php: $lang->cmd_modify = '수정';
ko.lang.php 파일에 "수정"이라는 단어가 포함 되어 있다.
[출처] 리눅스 find 명령어로 파일 내용 검색 하기|작성자 지구촌아이
'STUDY > Linux' 카테고리의 다른 글
커널 소스 트리 (0) | 2014.03.27 |
---|---|
커널 소스 분석에 도움을 주는 도구들 (0) | 2014.03.27 |
리눅스 find 명령어로 파일 내용 검색 하기 (0) | 2014.01.12 |
[Linux] 실행파일 백그라운드로 실행하기. (0) | 2013.12.20 |
Centos splint 설치 (0) | 2013.06.06 |
rdesktop 명령어 [윈도우 사용하기] (0) | 2013.05.19 |