Difference between revisions of "Grep"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
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:]]*$'
 +
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*$"