-
Grep code recursively between <script></script> tags
grep -oRP '<script[^>]*>(.*?)</script>'
-
Grep minimum six numbers
grep -E '[0-9]{6}' file.txt
-
Grep files that does not containt string
grep -L "foo" *
-
Find file and grep two values in one grep
find . -name 'myfile' -exec grep 'VAL1\|VAL2' {} ';'
-
Grep two patterns
grep -E 'pattern1.*pattern2' -r
-
Grep a tail output
tail -F file.txt|grep --line-buffered 'stringtogrep'
-
Print only filename
grep -l -R '\[a\]'
-
Grep word after match
grep -oP 'APP_SOCKET_URL=\K.*' .env
-
Grep line after match
grep -A2 "mymatch" myfile.txt
-
Grep 10 lines after match
grep -iR -A 10 'cors:'
-
Grep 5 lines before match
grep -iR -B 10 'cors:'
Last active
November 22, 2023 13:00
-
-
Save vpnwall-services/b5ee5387ada2e031196fdcc5b46207c7 to your computer and use it in GitHub Desktop.
[GREP 101] Grep 101 #grep #101 #find #word #line #after #before #recursive #between #tags #script
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I read that question and answer before asking here. I adjusted the code at https://stackoverflow.com/questions/50666954/switch-puls-audio-record-stream-for-gstreamer-pipeline
Now I will try to adjust the code to toggle between "monitor" device.class and device.class "sound" when the script is called. Thanks.