May 2017
Beginner
552 pages
28h 47m
English
The lsof (list open files) command will list open files. The -i option limits it to open network connections:
$ lsof -i COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME firefox-b 2261 slynux 78u IPv4 63729 0t0 TCP localhost:47797->localhost:42486 (ESTABLISHED) firefox-b 2261 slynux 80u IPv4 68270 0t0 TCP slynux-laptop.local:41204->192.168.0.2:3128 (CLOSE_WAIT) firefox-b 2261 slynux 82u IPv4 68195 0t0 TCP slynux-laptop.local:41197->192.168.0.2:3128 (ESTABLISHED) ssh 3570 slynux 3u IPv6 30025 0t0 TCP localhost:39263->localhost:ssh (ESTABLISHED) ssh 3836 slynux 3u IPv4 43431 0t0 TCP slynux-laptop.local:40414->boney.mt.org:422 (ESTABLISHED) GoogleTal 4022 slynux 12u IPv4 55370 0t0 TCP localhost:42486 (LISTEN) GoogleTal 4022 ...