I am looking to have after a command line to delete duplicates
I run the following command
[root@serveur ~]# netstat -tapen |grep :631| awk '{print $5}'|grep -v '0.0.0.0'
10.168.12.36:49836
10.168.12.36:49838
10.168.12.36:49873
10.168.12.36:49877
10.168.12.112:52732
10.168.12.112:52719
10.168.12.36:49839
10.168.12.36:49840
10.168.12.36:49878
10.168.12.36:49874
10.168.12.36:49837
10.168.12.112:52733
10.168.12.112:52731
10.168.12.36:49876`
I would like to have a unique ip, here is the result I would like to have
10.168.12.36:49838
10.168.12.112:52732
Thanks you
Osiris73
CodePudding user response:
Try with this
netstat -tapen |grep :631| awk '{print $5}'|grep -v '0.0.0.0' | cut -d ':' -f 1 | sort| uniq