How to find a code segment in multiple source code files?

Source: Internet
Author: User
There is a website with an invalid image link, and some more amazing characters. Now I want to find this code in php or database in multiple source code files and correct it. Is there a good way? There is a website with an invalid image link, and some more amazing characters.
Now I want to find this code in php or database in multiple source code files and correct it.
Is there a good way?

Reply content:

There is a website with an invalid image link, and some more amazing characters.
Now I want to find this code in php or database in multiple source code files and correct it.
Is there a good way?

For php code, what you need is not to "delete malicious code", but to incorporate the code into version management from the very beginning, in this way, when the website file is tampered with, it can be rolled back to the last deployment State at least.

Of course, considering the current situation of the subject, it is necessary to identify the tampering, so we need the help of powerful editors such as sublime text, notepad ++.

In addition, it is suggested that the best technique to find the files tampered with by the website is to screen the last modification time of the files ......

It is troublesome for databases. I'm afraid this is not a good solution except for screening or backup adjustment.

You can have a long snack...
Check the permissions. You are obviously under intrusion...

If you are searching for a key text in multiple files, you can use the following code on Linux or Mac:

grep -E "key_word" . -R --color=always -n

Content from here http://droidyue.com/blog/2014/05/15/quickly-find-content-in-files/

Sublime or NOTEPAD ++ CTRL + SHIFT + F

Git grep 'the character to be found '--' *. php'

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.