Difference between revisions of "Grep"
Jump to navigation
Jump to search
(Created page with "``` cat file | grep -v "^#\|^$" ```") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
``` | ``` | ||
cat file | grep -v "^#\|^$" | cat file | grep -v "^#\|^$" | ||
+ | |||
+ | grep -rl $oldstring /path/to/folder | xargs sed -i s@$oldstring@$newstring@g | ||
+ | ``` | ||
+ | |||
+ | |||
+ | ``` | ||
+ | grep -o '^[^#]*' file.yaml | grep -v -e '^[[:space:]]*$' | ||
+ | grep -o '^[^#]*' custom-values.yaml | grep -v "^\s*$" | ||
``` | ``` |
Latest revision as of 21:36, 27 December 2022
cat file | grep -v "^#\|^$" grep -rl $oldstring /path/to/folder | xargs sed -i s@$oldstring@$newstring@g
grep -o '^[^#]*' file.yaml | grep -v -e '^[[:space:]]*$' grep -o '^[^#]*' custom-values.yaml | grep -v "^\s*$"