Hi,
Can someone please help me with a Command to Search a FILE for a STRING in multiple DIRECTORIES.
I am searching for the VIP in HTTPD.CONF in multiple httpd instances.
I am using
find ./ -name "httpd.conf" | xargs grep 10.22.0.141 cut -d: -f3- | cut -d ' ' -f4 | sort | uniq -c
but its not working
charl@rom11-TEST $ ls -latr
total 124
-rwxr-xr-x 1 root root 24 Apr 8 2014 version.signature
drwxr-xr-x 2 root root 4096 Jul 29 2014 lafiles
drwxr-xr-x 2 root root 4096 Jul 29 2014 uninstall
drwxr-xr-x 4 root root 4096 Jul 29 2014 gsk8_2015-02-24_122927.18703
drwxr-xr-x 3 root root 4096 Jul 29 2014 logs
drwxr-xr-x 2 root root 4096 Jul 29 2014 cgi-bin
drwxr-xr-x 9 root root 4096 Jul 29 2014 ..
drwxr-x--- 4 root root 4096 Feb 24 12:29 gsk8_2015-02-24_124338.49359
drwxr-xr-x 2 root root 4096 Feb 24 12:48 util
drwxr-xr-x 2 root root 4096 Feb 24 12:48 example_module
drwxr-xr-x 4 root root 4096 Feb 24 12:48 modules
drwxr-xr-x 4 root root 4096 Feb 24 12:48 man
drwxr-xr-x 2 root root 4096 Feb 24 12:48 readme
drwxr-xr-x 2 root root 4096 Feb 24 12:48 include
drwxr-xr-x 3 root root 4096 Feb 24 12:48 error
drwxr-xr-x 4 root root 4096 Feb 24 12:48 gsk8
drwxr-xr-x 3 root root 4096 Feb 24 12:48 icons
drwxr-xr-x 2 root root 4096 Feb 24 12:48 codeset
drwxr-xr-x 4 root root 4096 Feb 24 12:48 java
drwxr-xr-x 9 root root 4096 Feb 24 12:48 properties
drwxr-xr-x 2 root root 4096 Feb 24 12:48 build
drwxr-xr-x 3 root root 4096 Feb 24 12:48 htdocs
drwxr-xr-x 3 root root 4096 Feb 24 12:48 bin
drwxr-xr-x 2 root root 4096 Feb 24 12:49 lib
drwxr-xr-x 2 root root 4096 Feb 24 13:16 conf
drwxr-xr-x 30 root root 4096 Mar 9 13:41 .
drwxrwxr-x 7 root root 4096 Mar 9 13:41 bofac-Wrapper
drwxr-xr-x 7 root root 4096 Jul 29 2014 bofac-admin
drwxrwxr-x 7 root root 4096 Jul 29 2014 bofac-chas-test
drwxrwxr-x 7 root root 4096 Jul 29 2014 bofac-chasdps-test
drwxrwxr-x 7 root root 4096 Oct 10 14:09 bofac-vpn-chas-test
basically the httpd instances are highlighted in red but I would ideally run the command against the entire directory.
Thanks