develog

[bash] grep -n 본문

카테고리 없음

[bash] grep -n

냐옴 2022. 7. 6. 13:06

 

## 현재 폴더에서 파일을 먼저 찾고
## 찾은 파일에서 '문자'를 검색하고 라인번호를 찍는다
find . -type f | xargs grep -n 'insert' --color=auto

## 현재 폴더와 서브 폴더에서 '문자'를 검색하고 라인번호를 찍는다
grep -rn 'insert' .

 

Comments