Given an IP address 192.168.10.21.somebody.com.br I need to extract just 192.168.10.21 I tried CUT below, it gives "cut: invalid byte or field list".
cut -d'.' -f-4
$ echo "192.168.10.21.somebody.com.br" | cut -d'.' -f -4
192.168.10.21
works for me!