Answer the question
In order to leave comments, you need to log in
How to remove multiple lines from a file?
Hello, I need a bash command that can remove this from .htaccess files:
RewriteEngine On
RewriteBase /
RewriteRule \.(jpg|png|gif|jpeg|bmp)$ - [L]
RewriteCond %{HTTP_USER_AGENT} android|bb\d+...
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /crystal/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /crystal/index.php [L]
</IfModule>
# END WordPress
Answer the question
In order to leave comments, you need to log in
You should change the owner of the file to root and give read-only access so that no one steals traffic from you.
1. option to remove the virus, as far as I understand the problem is that you constantly have to remove its consequences. Try ai-bolit.php
2. It's really easier for you to install a php proger, since there are more possibilities in pregmatch than in the console.
3. If you want to use bash, then sed is in your hands, and regular expressions, by the way, too.
You only need to remove two lines
RewriteRule \.(jpg|png|gif|jpeg|bmp)$ - [L]
RewriteCond %{HTTP_USER_AGENT} android|bb\d+...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question