type of grep
This commit is contained in:
onceupon 2018-10-24 17:23:35 +08:00 committed by GitHub
parent 5a9b0c3372
commit 89eb5d75f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,15 @@ or
## Grep
[[back to top](#handy-bash-oneliner-commands)]
##### Type of grep
```bash
grep = grep -G # Basic Regular Expression (BRE)
fgrep = grep -F # fixed text
egrep = grep -E # Extended Regular Expression (ERE)
pgrep = grep -P # Perl Compatible Regular Expressions (PCRE)
rgrep = grep -r # recursive
```
##### Grep only IP address
```bash
grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'