Linux process monitoring commands
Kill a process on a port: sudo kill -9 $(sudo lsof -t -i:#port-no)
top: Provides a list of all the active processes in the machine, refreshes every 5s
lsof: List of open files, it is a command line utility that is used to list the information about the files that are opened by various processes. In Linux, everything is a file, ( pipes, sockets, directories, devices, etc.). So by using lsof, you can get the information about any opened files.
netstat: Netstat command displays various network-related information such as network connections, routing tables, interface statistics, masquerade connections, multicast memberships etc.
netstat -at: List all tcp ports using netstat
netstat -ud: List all udp ports using netstat
iostat: The iostat command in Linux is used for monitoring system input/output statistics for devices and partitions. It monitors system input/output by observing the time the devices are active in relation to their average transfer rates.
Comments
Post a Comment