Get IPs from file grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' ips_input.txt | sort | uniq > ips_output.txt