ack -l text | xargs perl -pi -E ‘s/text/text_new/g’

text : you can use regex pattern but no for all regex pattern s/text : old tex text_new/g: new text