How do I extract just the source IPs from active connections?
Try: ss -tn state established | awk 'NR>1 {split($3,a,":"); print a[1]}' | sort -u Info: First run ss to see the raw output, then use awk to parse it. split($3,a,":") splits IP:PORT into array a. NR>1 skips the header line. Examples: $ ip -4 addr | awk '/inet / && !/127.0/ […]
Read More