۰۳
آذر
Examples
$ grep Expression File.txt
Search in file
$ grep [ -F, --fixed-strings] Expression File.txt
grep -F = fgrep
list of fixed string PATTERN (instead of regular expressions),
separated by newlines(any of which is to be matched)
$ grep –E “……”
هر چیز شش حرفی(اگر بیشتر هم شد اشکال ندارد فقط شش تا باشد)
$ cat فایل |grep -e Expression1 -e Expression2
search Multi pattern
$ grep -E Expression = egrep Expression
both is equal
$ grep ^Expression file
start with Expression
$ grep [0-9] file
All lines have number
$ grep Expression -R Directory
Search in all files in Directory looking for pattern
Switch
[-n, --line-number] #Show line number
[-i, --ignore-case #Ignore case distinctions in both the PATTERN and the input files.
]