I have encountered some malware on my Linux server, and am trying to remove it from many php files.I've tried endlessly with grep | sed and grep | tr and couldn't even erase a simple text string, getting different errors.When trying:grep -l '@error' * | xargs -0 sed -i 's/error/nothing/g'   I receive an error message:can't read filename.phpUsing Terminal on Mac - maybe it's an OSX syntax problem?My final task is to delete a long string of code from all the files - one that includes some $,!,?,<,>,\, symbols - will I need to backslash them? 
Removing a long string from php files - using grep and sed?
linux;grep;sed;php;tr
You should restore from backup or source control as @Mat suggested because otherwise you cannot be 100% sure you cleaned up everything.The problem with your command is the -0 flag for xargs, because that way xargs is expecting null-terminated arguments, which does not work with the output of grep -l. Just drop the -0 and it will work, as long as the file names don't have white spaces in them.grep -l '@error' * | xargs sed -i 's/error/nothing/g'