mirror of
https://github.com/onceupon/Bash-Oneliner.git
synced 2024-11-22 21:07:00 +00:00
add grep
This commit is contained in:
parent
258c11caa3
commit
257008525c
10
README.md
10
README.md
@ -120,6 +120,16 @@ if [ $? -eq 0 ]; then echo 'found'; fi
|
|||||||
//grep -q will output 0 if match found
|
//grep -q will output 0 if match found
|
||||||
//remember to add space between []!
|
//remember to add space between []!
|
||||||
|
|
||||||
|
#####grep strings between a bracket()
|
||||||
|
```bash
|
||||||
|
grep -oP '\(\K[^\)]+'
|
||||||
|
```
|
||||||
|
|
||||||
|
#####grep number of characters with known strings in between(e.g. AAEL000001-RA)
|
||||||
|
```bash
|
||||||
|
grep -o -w "\w\{10\}\-R\w\{1\}"
|
||||||
|
```
|
||||||
|
// \w word character [0-9a-zA-Z_] \W not word character
|
||||||
|
|
||||||
|
|
||||||
##Sed
|
##Sed
|
||||||
|
Loading…
Reference in New Issue
Block a user