grep
(Regular Expressions) البحث عن أنماط في الملفات باستخدام التعابير النمطية. لمزيد من التفاصيل: https://www.gnu.org/software/grep/manual/grep.html.
grep "{{search_pattern}}" {{path/to/file}}
grep {{[-F|--fixed-strings]}} "{{exact_string}}" {{path/to/file}}
grep {{[-r|--recursive]}} {{[-n|--line-number]}} --binary-files {{without-match}} "{{search_pattern}}" {{path/to/directory}}
?
, +
, {}
, ()
, و |
)، في وضع عدم التمييز بين الأحرف الكبيرة والصغيرة:grep {{[-E|--extended-regexp]}} {{[-i|--ignore-case]}} "{{search_pattern}}" {{path/to/file}}
grep --{{context|before-context|after-context}} 3 "{{search_pattern}}" {{path/to/file}}
grep {{[-H|--with-filename]}} {{[-n|--line-number]}} --color=always "{{search_pattern}}" {{path/to/file}}
grep {{[-o|--only-matching]}} "{{search_pattern}}" {{path/to/file}}
stdin
عن الأسطر التي لا تطابق النمط:cat {{path/to/file}} | grep {{[-v|--invert-match]}} "{{search_pattern}}"