Difference between revisions of "Grep"
Jump to navigation
Jump to search
Line 3: | Line 3: | ||
grep -rl $oldstring /path/to/folder | xargs sed -i s@$oldstring@$newstring@g | grep -rl $oldstring /path/to/folder | xargs sed -i s@$oldstring@$newstring@g | ||
+ | ``` | ||
+ | |||
+ | |||
+ | ``` | ||
+ | grep -o '^[^#]*' file.yaml | grep -v -e '^[[:space:]]*$' | ||
``` | ``` |
Revision as of 21:31, 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:]]*$'