How it is possible to make a dry run with sed
?
I have this command:
find ./ -type f | xargs sed -i \'s/string1/string2/g\'
I would prefer to use the p-option:
find ./ -type f | xargs sed 's/string1/string2/gp'
Could be combined with the --quiet parameter for less verbose output:
find ./ -type f | xargs sed --quiet 's/string1/string2/gp'
From man sed
:
p:
Print the current pattern space.
--quiet:
suppress automatic printing of pattern space