php - Osx: delete all first line of multiple files -
I read a lot of threads about my question, but I can not understand how my problem solves.
I have a lot of WordPress files that start with the wrong first line, I think my WordPress was hacked, and each .php file starts with a long set of functions, only In the first line
I tried removing the first line of each file with the terminal through the terminal.
I run this command
find -type f -name "* .php" | Xargs sed -i '' '1d' but only removes the first line on the first file; I do not know why
Hope this is not a question already answered.
Thanks in advance.
You do not have to go for xargs , find the function < Code> -execdir will help you run an external command to find yourself. Search-type f -name "* .php" -execdir sed -i '1d' {} \; OR Search-type f -name "* .php" -execdir sed -i '' '1d' {} \;
Comments
Post a Comment