Files
tldr/pages.fa/common/grep.md
K.B.Dharun Krishna 5c26174aa9 pages/*: update links and more info link script (#11390)
* pages/*: update links and more info link script

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>

* cleanup: reformat code

* ax-webapp: fix link

* curl: fix false positive

Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>

---------

Signed-off-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
2023-11-06 23:14:12 +05:30

37 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# grep
> یافتن الگو در فایل ها به کمک عبارات با قاعده.
> اطلاعات بیشتر: <https://www.gnu.org/software/grep/manual/grep.html>.
- جستجو یک الگو در یک فایل :
`grep "{{الگو_جستجو}}" {{مسیر/به/فایل}}`
- جستجو یک عبارت خاص (معادل مقایسه رشته ای) :
`grep --fixed-strings "{{رشته_مورد_نظر}}" {{مسیر/به/فایل}}`
- جستجو بازگشتی یک الگو در تمامی فایل های یک پوشه، نمایش تمامی خطوط منطبق، فایل های باینری را رد میکند:
`grep --recursive --line-number --binary-files={{without-match}} "{{الگو_جستجو}}" {{مسیر/به/پوشه}}`
- استفاده از عبارات با قاعده توسعه یافته (با پشتیبانی از `?`، `+`، `{}`، `()` و `|`)، در حالت حساس به بزرگی کوچکی کاراکتر ها :
`grep --extended-regexp --ignore-case "{{الگو_جستجو}}" {{مسیر/به/فایل}}`
- چاپ 3 خط از قبل و بعد محل انطباق:
`grep --{{context|before-context|after-context}}={{3}} "{{الگو_جستجو}}" {{مسیر/به/فایل}}`
- چاپ نام فایل و شماره خط برای هر انطباق با رنگبندی :
`grep --with-filename --line-number --color=always "{{الگو_جستجو}}" {{مسیر/به/فایل}}`
- جستجوی خطوط منطبق، چاپ متن منطبق :
`grep --only-matching "{{الگو_جستجو}}" {{مسیر/به/فایل}}`
- ورودی استاندارد (stdin) رو برای الگوهایی که منطبق نیستند جستجو میکند :
`cat {{مسیر/به/فایل}} | grep --invert-match "{{الگوی_جستجو}}"`