Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running the following command but not all files that I know have this string are being returned and I cannot work out why. Specifically the apache log files which are under this path are not being returned.

grep -rl "eval(base64_decode('" /var/www | xargs ls -l

Can anyone point me to what I need to change to get these files returned too?

share|improve this question
    
I am not sure , But i think you should try as root . –  raaz Dec 27 '12 at 17:29
    
Nope if I sudo it I get the same results. –  williamsdb Dec 27 '12 at 17:32
    
There is nothing wrong with your command. I tested the same and I'm able to get the results $ sudo grep -rl "eval(base64_decode('" /var/www | xargs ls -l -rw-r--r-- 1 root root 28 Dec 28 00:01 /var/www/drupal/themes/garland/deletethis1.txt -rw-r--r-- 1 root root 34 Dec 28 00:00 /var/www/drupal/themes/garland/deletethis.txt –  devav2 Dec 27 '12 at 19:13
add comment

1 Answer

The script is fine. I guess that your Apache logs don't contain the text matching the pattern.

share|improve this answer
    
Strange. Log files definitely contain the string as I have search manually. Have to try something else I guess. –  williamsdb Dec 30 '12 at 16:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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