Security issue? netstat -ntu shows blank line in output

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
Here are the bottom 10 or so lines after running:
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

2 210.213.238.11
2 213.96.228.45
2 65.54.188.142
2 66.249.65.162
2 67.170.117.81
6 127.0.0.1
7 203.59.162.161
20
26 60.230.255.210

Should I be concerned about line #20 there?
 

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
See what output you get without piping through "cut"

Thanks much.

Would the line just look like this, then?:

netstat -ntu | awk '{print $5}' | -f1 | sort | uniq -c | sort -n
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
Remove the '-f1' ... that's part of the "cut" command.

Code:
cut -d: -f1
That basically says to take the output text being piped through
and cut up the lines into columns divided by a colon character
and return only the first section of each line that appears
before the first colon character and discard the rest.

I suspect your so called extra line from netstat is appearing
because you are filtering a line through that cut pipe that
is not really netstat output but perhaps formatting lines or
surrounding comment or title text instead resulting in
a blank line being output in your final output.

If you don't pipe through "cut" then you can see the actual
real output that resulted from netstat without it being trimmed
and can see what really appears on that blank line of yours.