DEV Community

bugb
bugb

Posted on

Find all ip addresses in a project

When doing a task about migration server for a project, my first thing to do is find what these external API endpoint (usually it comes with ip address like

10.10.0.1
123.123.123.123
Enter fullscreen mode Exit fullscreen mode

To find all ip address in a project we can use grep command from root project directory:

 grep -r -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" .
Enter fullscreen mode Exit fullscreen mode

You can also exclude directory when using grep, example:

 grep -r --exclude-dir=node_modules -oE "([0-9]{1,3}\.){3}[0-9]{1,3}" .
Enter fullscreen mode Exit fullscreen mode

Latest comments (0)