Is there a simple way to recursively search all files in a directory hierarchy for a term (e.g. port) and replace all occurrences of that term with another (e.g. port-lookup).
I have tried the suggestions in this post, but they are only applicable for a single file.
Try this
find ./ -type f -exec sed -i -e 's/port/port-lookup/g' {} \;
If you don't want to change file modification time
grep -rl 'port' /search_in_this_dir | xargs sed -i 's/port/port-offset/g'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With