See if netstat is installed:

# netstat -v

If not, install it (for Linux):

# yum install net-tools     (CentOS / RedHat 7)
# dnf install net-tools     (CentOS / RedHat 9)
# apt install net-tools     (Debian / Ubuntu)

Shows all connections:

# netstat -a

Shows all connections on port 22 (SSH): using grep
Use "| grep" to filter the results:

# netstat -ant | grep 22

Shows how many connections are active on port 22 (SSH):
Use "| grep 22" to filter the result to port 22 and "| wc -l" to show the number of lines (in here is number of connections):

# netstat -ant | grep 22 | wc –l

Shows all UNIX domain sockets:

# netstat -an

Shows all UNIX domain sockets - (If they don't fit on the page use " | more" ):

# netstat -an | more

Shows all active TCP connections:

# netstat -at

Shows all active UDP connections:

# netstat -au

Shows all listening ports (UNIX domain and Internet connections):

# netstat -l

Shows all listening ports (Internet connections):

# netstat -ant | grep LISTEN

Shows all listening TCP ports:

# netstat -lt

Shows all listening UDP ports:

# netstat -lu