Linux: lsof command and its uses

How to view only TCP Established connections

lsof -iTCP | grep ESTABLISHED

How to view traffic on specific port ( port 22)

Syntax is : lsof -i : port number
lsof -i :22  | grep ESTABLISHED

How to view traffic from specific ip address

lsof -i@ip.of.your.user

how to view open files by a individual users

lsof -u username

How to collect information about a process

lsof -p process_id

Leave a Reply

*