I use the following line to replace a string in files:
ag -Q -l "$1" | xargs sed -i '' "s/$1/$2/g"
ag is the_silver_searcher, of course.
How can I also count the number of files that were affected by this change?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community