-2


I'd need to remove all empty lines which are contained in all the files named "pom.xml". I've come up with this:

find . -name 'pom.xml' -exec sed '/^$/d'  {} \;

But it just prints out the output on the screen, which is by the way correct. I'd need however to change the files with that command. Any help? Thanks

Carla
  • 3,064
  • 8
  • 36
  • 65

1 Answers1

0

Try to add -i flag to sed, which means instantly change the file in place, instead of output the result.

find . -name 'pom.xml' -exec sed -i '/^$/d'  {} \;
Wan Chap
  • 841
  • 7
  • 13