Giter Club home page Giter Club logo

python-netshow's Introduction

python-netshow

A friendlier version of netstat

usage

usage: netshow.py [--json|--dict|-s|-h] ['PATTERN' | WORDS]

--json    : Output as iterable of JSON objects.
--dict    : Output as list of dicts.
-s        : Hide header
-h|--help : Help

Wrap regex in single quotes.
Words can be any whole-string match.

examples

  • ./netshow.py
Proto                           Local Address Port                          Foreign Address Port  State         PID Program name
tcp                                   0.0.0.0 22                                    0.0.0.0 *     LISTEN       1101 /usr/sbin/sshd
tcp                            172.28.142.138 22                             192.168.162.33 54101 ESTABLISHED 13269 /usr/sbin/sshd
udp                            172.28.142.138 123                                   0.0.0.0 *                  1109 /usr/sbin/ntpd
udp                                 127.0.0.1 123                                   0.0.0.0 *                  1109 /usr/sbin/ntpd
udp                                   0.0.0.0 123                                   0.0.0.0 *                  1109 /usr/sbin/ntpd
tcp6                                       :: 22                                         :: *     LISTEN       1101 /usr/sbin/sshd
udp6                 fe80::250:56ff:feb1:69bd 123                                        :: *                  1109 /usr/sbin/ntpd
udp6                                      ::1 123                                        :: *                  1109 /usr/sbin/ntpd
udp6                                       :: 123                                        :: *                  1109 /usr/sbin/ntpd
  • ./netshow.py udp6
Proto                           Local Address Port                          Foreign Address Port  State         PID Program name
udp6                 fe80::250:56ff:feb1:69bd 123                                        :: *                  1109 /usr/sbin/ntpd
udp6                                      ::1 123                                        :: *                  1109 /usr/sbin/ntpd
udp6                                       :: 123                                        :: *                  1109 /usr/sbin/ntpd
  • ./netshow.py '22|123' -s
tcp                                   0.0.0.0 22                                    0.0.0.0 *     LISTEN       1101 /usr/sbin/sshd
tcp                            172.28.142.138 22                             192.168.162.33 54101 ESTABLISHED 13269 /usr/sbin/sshd
udp                            172.28.142.138 123                                   0.0.0.0 *                  1109 /usr/sbin/ntpd
udp                                 127.0.0.1 123                                   0.0.0.0 *                  1109 /usr/sbin/ntpd
udp                                   0.0.0.0 123                                   0.0.0.0 *                  1109 /usr/sbin/ntpd
tcp6                                       :: 22                                         :: *     LISTEN       1101 /usr/sbin/sshd
udp6                 fe80::250:56ff:feb1:69bd 123                                        :: *                  1109 /usr/sbin/ntpd
udp6                                      ::1 123                                        :: *                  1109 /usr/sbin/ntpd
udp6                                       :: 123                                        :: *                  1109 /usr/sbin/ntpd
  • ./netshow.py LISTEN
Proto                           Local Address Port                          Foreign Address Port  State         PID Program name
tcp                                   0.0.0.0 22                                    0.0.0.0 *     LISTEN       1101 /usr/sbin/sshd
tcp6                                       :: 22                                         :: *     LISTEN       1101 /usr/sbin/sshd

python-netshow's People

Contributors

jhazelwo avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.