bash search, find, replace, sed, awk, grep
find
find files with name containing foo
find -type f -name '*.foo'
output with no line break
find -type f -name '*.foo' -print0
find not recusively, maximum depth
find -type f -name 'foo' -maxdepth 1
grep
look for foo
-rrecursively where/path/-noutput filenames with line number
grep -nr -e 'foo' /path/
-loutput file names wherefoois found-Zoutput filenames with no line break (like-pint0)
grep -rlZ 'foo' /path/
--include \*.barsearch for files wich name contains*.bar
sed
replace foo with bar on file
sed -i 's/foo/bar/g file
same but keep and rename original file with .bak
sed -i.bak 's/foo/bar/g file
concatenate
- find
foorecursively in/path/and replace it bybar
grep -rlZ 'foo' /paht/ | xargs -0 sed -i 's/foo/bar/g'