정규표현식으로 파일에서 패턴을 찾습니다. 더 많은 정보: https://www.gnu.org/software/grep/manual/grep.html.
grep "{{검색_패턴}}" {{파일/의/경로}}
grep {{-F|--fixed-strings}} "{{문자열}}" {{파일/의/경로}}
grep {{-r|--recursive}} {{-n|--line-number}} --binary-files={{without-match}} "{{검색_패턴}}" {{디렉토리/의/경로}}
?
, +
, {}
, ()
그리고 |
를 지원):grep {{-E|--extended-regexp}} {{-i|--ignore-case}} "{{검색_패턴}}" {{파일/의/경로}}
grep --{{context|before-context|after-context}} 3 "{{검색_패턴}}" {{파일/의/경로}}
grep {{-H|--with-filename}} {{-n|--line-number}} --color=always "{{검색_패턴}}" {{파일/의/경로}}
grep {{-o|--only-matching}} "{{검색_패턴}}" {{파일/의/경로}}
stdin
검색:cat {{파일/의/경로}} | grep {{-v|--invert-match}} "{{검색_패턴}}"