Linux [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Linux [Electronic resources] - نسخه متنی

Janet Valade

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید


grep (find text in files)


Searches one or more files for text that matches regular expressions. The grep command is described in Chapter 7.

Format: grep pattern filelist
Examples: grep "^Table [0-9]:" *

Displays each line that matches the regex. The filename and line number is listed.

Opt

What It Does

Example

-A n

Display n lines after the match

grep -A 3 Table *

-B

Display n lines before the match

grep -B 3 Table *

-c

Display only count of matched lines, not the text

grep -c Table *

-C

Display two lines before and after the matching line

grep -C include *

-i

Ignore case

grep -I Table report*

-r

Search files in subdirectories also

grep -r Table *

-v

Display lines that do not match

grep -v Error *

-w

Match whole words only

grep -w Table *.txt

-x

Match whole lines only

grep -x "This is a line" *


    / 357