use nmap to scan port and store open ips code example
Example 1: nmap scan network ip
sudo nmap -sP 10.10.0.0/24
Example 2: nmap port scan
How to scan all target ports
Sudo nmap pasteheretargetip
sudo nmap -sP 10.10.0.0/24
How to scan all target ports
Sudo nmap pasteheretargetip