How can I search which file in a repository contains an IP address?

How do you find an ip address in one of many config files in a github enterprise repository? I've tried with quotes, without and I get all kinds of whacky variants but not the file with the IP address I want.
LVL 2
amigan_99Network EngineerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve BinkCommented:
Can you use grep?  From the root directory of the repo:
grep -rn '1.2.3.4' ./*

Open in new window

amigan_99Network EngineerAuthor Commented:
It didn't appear to understand that.

We couldn’t find any code matching 'grep -rn '10.74.15.50' ./*' in acme/network-configs
gelonidaCommented:
Just to be sure: You did clone the repository to your machine.

Did you checkout the correct branch.

If yes, then
cd to the top directory of your repository.

git grep '10\.74\.15\.50'

Open in new window



And one more question:
The files in which you grep for the IP-address have an ASCII like 8 bit encoding  like  ASCII UTF-8 CP1252, . . . ?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
amigan_99Network EngineerAuthor Commented:
So what worked was your idea to clone the repository locally. I'm using Windows but I have Git Bash shell on here. From there i could run your original search criteria. Seems odd that I can't search Github enterprise for a simple IP address through their web interface. But this will work great as we have hundreds of network devices. Thank you.

MINGW64 ~/Downloads/network-configs-master123/network-configs-master
$ grep -rn '10.74.15.50' ./*
./prod-lb73-fiji.internal.acme.com:1191:add lb vserver prcc.acme-80 HTTP 10.74.15.50 80 -persistenceType NONE -cltTimeout 180
./prod-lb73-fiji.internal.acme.com:1192:add lb vserver prcc.acme-443 SSL 10.74.15.50 443 -persistenceType NONE -cltTimeout 180
./prod-lb83-fiji.internal.acme.com:1191:add lb vserver prcc.acme-80 HTTP 10.74.15.50 80 -persistenceType NONE -cltTimeout 180
./prod-lb83-fiji.internal.acme.com:1192:add lb vserver prcc.acme-443 SSL 10.74.15.50 443 -persistenceType NONE -cltTimeout 180
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Git

From novice to tech pro — start learning today.