Difference between revisions of "Grep"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
Line 8: Line 8:
 
```
 
```
 
grep -o '^[^#]*' file.yaml | grep -v -e '^[[:space:]]*$'
 
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*$"