IT/Tip
[Linux] grep 간단 사용법
현무랑 니니
2015. 3. 12. 23:59
반응형
1. 파일에서 특정 문자열 검색
$ grep "math and eng" /home/hyunmu/*.txt
or
$ grep "math and eng" ~/*.txt
2. 하위 디렉터리까지 재귀적으로 검색
$ grep -r "math and eng" /home/hyunmu/*.txt
or
$ grep -R "math and eng" /home/hyunmu/*.txt
3. 찾은 파일만 표시.
$ grep -H -r "math and eng" /home/hyunmu/*.txt
or
$ grep -H -R "math and eng" /home/hyunmu/*.txt
반응형