I have a WordPress site and want to change first line of all php files recursively using bash. How should I do? I am not very familiar with bash.
Change first line to some other line:
sed -i '1s/.*/changed line/' *.php
Adding a line before first line:
sed -i '1s/^/changed line\n/' *.php