Parsing a file for a string of text
I need to parse all the files on my system to one that includeds the following string of text, "echo 1 > /proc/sys/net/ipv4/ip_forward". I have checked all the normal files where it should have been placed.
I have tried grep but I guess i did not use it properly, grep / <echo 1 > /proc/sys/net/ipv4/ip_forward> Thanks James Wadkins james@vtat.com |
Ok, I think your problem is that you are only searching your root "/" directory with the command "grep / <echo 1 > /proc/sys/net/ipv4/ip_forward>" If you want to seach your entire filesystem add the recursive flag, ie:
grep -r / <echo 1 > /proc/sys/net/ipv4/ip_forward> I also don't think you need the square brackets "< and >" around the line you are trying to locate. Hope this helps. . . |
It's resource intensive, but something like the following should work:
find / -type f -exec grep -H "echo 1 > /proc/sys/net/ipv4/ip_forward" {} \; I suspect that you're trying to find out where forwarding gets turned on. I didn't see a distribution mentioned, but /etc/init.d should be a good place to start looking. I would suspect that it should be somewhere in /etc for your distro. My /etc/init.d/ipsec has something similar to this in it. |
All times are GMT -5. The time now is 12:11 PM. |