Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

How to do it...

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985