I love to use the following command to do find / replace across multiple files in bash:
find -wholename "*.txt" -print | xargs sed -i 's/foo/bar/g'
However, the above command process everything in silence, and sometimes I would like the above command to print all the changes it made in order to double check if I did everything correctly. Can I know how should I improve the above command to allow it to dump such information? I tried the -v
argument in the xargs
command but it gives me the invalid option
error.