I need to extract the characters before last colon :
and also remove the square brackets []
in the last line.
My file structure is
256.XXX.XXX.X:20234
214.XXX.XXX.X:7249
[2200:XXXX:XXXX:XXX:XXXX:XXXX:XXXX:XXXX]:46288
I need output file as in the form of:
256.XXX.XXX.X
214.XXX.XXX.X
2200:XXXX:XXXX:XXX:XXXX:XXXX:XXXX:XXXX
[ ]
, but you don't mention it – Philippos May 13 '19 at 15:06netstat
result which contains IP and port? – Ivan Chau May 14 '19 at 06:15