vamsi_uk
asked on
Listing files that contain IP addresses
Hi Experts,
how can i list all the files on my system which has IP addresses in them?
Thanks a lot
Vamsi
how can i list all the files on my system which has IP addresses in them?
Thanks a lot
Vamsi
ASKER
Hi kdo,
I think my question was not clearly written, sorry for that. What i meant is that i want to list the name of the files that contain an IP address inside that file contents (not in the file name)
thanks
I think my question was not clearly written, sorry for that. What i meant is that i want to list the name of the files that contain an IP address inside that file contents (not in the file name)
thanks
Use grep to do the same. Though I suggest that you use it on selected directories and not the entire system.
To search from the current directory (and all subdirectories) try this:
grep -lR '[0-9]*\.[0-9]*\.[0-9]*\.[
Kent
ASKER
Hi kdo,
I have tried the command that you gave me and i got this error message:
root@server1:/data> grep -lR '[0-9]*\.[0-9]*\.[0-9]*\.[ 0-9]*' .
grep: illegal action -- R
Usage: grep -hblcnsviw pattern file . . .
Btw: Im using solaris 7, is that why im getting this problem?
I have tried the command that you gave me and i got this error message:
root@server1:/data> grep -lR '[0-9]*\.[0-9]*\.[0-9]*\.[
grep: illegal action -- R
Usage: grep -hblcnsviw pattern file . . .
Btw: Im using solaris 7, is that why im getting this problem?
Yeah. The 'R' option means recursively check subdirectories but it isn't a universal option. I don't know what option you'll need in a Solaris environment.
Kent
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks a lot guys, i've got the expected results with that solution., im increasing the points and sharing between you both.
Cheers!
Vamsi
Cheers!
Vamsi
find / | grep '[0-9]*\.[0-9]*\.[0-9]*\.[
Note that this will list files with names that appear like IP address. There's no guarantee that the name is an actual address.
Good Luck,
Kent