Saturday, July 30, 2016

Netstat (Network Statistics)

Netstat

In computing, netstat (network statistics) is a command-line tool that displaysnetwork 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. It is available on Unix, Unix-like, and Windows NT-based operating systems.
It is used for finding problems in the network and to determine the amount of traffic on the network as a performance measurement.

Check all the recently logged user:-
[root@localhost ~]# last
This will show you the all current logged in users.

check loged in user and the user never logged in:-
[root@localhost ~]# lastlog
This will show you all the logged in user and the user never logged in.

To check listening and connected socket:-
 [root@localhost ~]# netstat

To check all the open TCP connected socket:-
[root@localhost ~]# netstat -tnlp

To check all the open UDP connected socket:-
 [root@localhost ~]# netstat -unlp

To check both tcp/UDP socket:
 [root@localhost ~]# netstat -tunlp

Check all the tcp based current connection:-
 [root@localhost ~]# netstat -ant

No comments:

Post a Comment