-
Hi
Could anyone know how to use the unix GREP/FIND to find a string in all the files and directories(including subdirectories and files)
there are some hardcoded IP's at the server level, so i need to find the string in all the files, starting from root.
any ideas ????
thanx in advance..
sravan
-
use
find / -type f -exec grep -l "IP" {} \;
why ?
find / -type f -> find all files starting from /
find .... -exec -> for each item found, do the following command. Where you normally place the filename in you command, put {} .
grep -l "IP" something -> returns the filename if string "IP" is found in file something
Hope this helps
Gert
-
re:
Thanx!!! for your advice.... it helped me a lot.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|