하늘높이의 프로그래밍 이야기

 

리눅스 시스템에서 하위 폴더를 쭉 긁어가며 소스의 원하는 내용을 찾고 싶을 때....

$ grep -rniI <Keyword>

[kunmin@linux]$ grep –help

사용법: grep [옵션]... 패턴 [파일] ...
Search for PATTERN in each FILE or standard input.
Example: grep -i 'hello world' menu.h main.c

Regexp selection and interpretation:

  -i, --ignore-case         ignore case distinctions
 

Output control:

  -n, --line-number         print line number with output lines
      --line-buffered       flush output on every line



  -R, -r, --recursive       equivalent to --directories=recurse
      --include=PATTERN     files that match PATTERN will be examined
      --exclude=PATTERN     files that match PATTERN will be skipped.
      --exclude-from=FILE   files that match PATTERN in FILE will be skipped.
  -l, --files-with-matches  only print FILE names containing matches
 

`egrep' means `grep -E'.  `fgrep' means `grep -F'.
With no FILE, or when FILE is -, read standard input.  If less than
two FILEs given, assume -h.  Exit status is 0 if match, 1 if no match,
and 2 if trouble.

Report bugs to bug-gnu-utils@gnu.org.

* 단 CPU 부하는 크니 주의할 것