Horje
grep exact match Code Example
grep exact match
echo olavo|grep -E "^olavo$" # returns olavo
echo olavo|grep -E "ola$"    # returns none
grep first match
Just combine grep with head command for filtering  only the first match as:
grep "match" | head -n 1   #Change 1 to not only match first but further matches
grep or match
$ grep "PATTERN1\|PATTERN2" FILE
$ grep -E "PATTERN1|PATTERN2" FILE
$ grep -e PATTERN1 -e PATTERN2 FILE
$ egrep "PATTERN1|PATTERN2" FILE




Shell

Related
powershell grab regex Code Example powershell grab regex Code Example
list envs Code Example list envs Code Example
list variables linux Code Example list variables linux Code Example
powershell get all environment variables Code Example powershell get all environment variables Code Example
test smb connection linux Code Example test smb connection linux Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
15