Why does this match

[03/Sep/2021:18:58:29 +0200] "GET /up/wp-admin/install.php HTTP/1.1" 404 6197


But in grep it does not?

sudo grep -rh ".*\/.+\/wp-admin.*404" /var/log/apache2/ | wc -l

I know the line exists in that folder. If I replace + by * it works.

1 Answer 1


With GNU grep, you have to backslash-escape the '+' character. Can you please try this grep -rh ".*\/.\+\/wp-admin.*404" /var/log/apache2/ | wc -l

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.