Solution
Example
netstat -n | grep :8080 | grep ESTABLISHED | wc -l
Explanation
netstat (network statistics) command displays network connections (both incoming and outgoing), routing tables, and a number of network interface (network interface controller or software-defined network interface) and network protocol statistics.
-n: Show numerical addresses instead of trying to determine symbolic host, port or user names
grep (global regular expression print) command processes text line by line and prints any lines which match a specified pattern.
wc (word count) command prints a count of newlines, words, and bytes for each input file.
-l: print the newline counts.
No comments:
Post a Comment