- 특정 파일의 내용 변경하기
find ./ -name "*.php" -exec perl -pi -e 's/old/new/g' {} \;
펄로 정규표현식의 내용 수정
- 파일에서 문자열 검색
find . -name "*.php" -exec grep -Hn 'str' {} \;
find . -name "*.[html]" -exec grep -Hn 'str' {} \;
php안에서 str이라는 스트링 검색
H: 파일 이름 출력
n: 행번호 출력
- grep으로 파일 검색
grep -RIwHn str *
R: 재귀적 디렉토리 탐색
I: 이진파일 건너뛰기
w: 전체단어(whole word)
H: 파일 이름 출력
n: 행 번호 출력