Skip to content

mezantrop/sockstat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sockstat for macOS

CodeQL C/C++ CI

FreeBSD-like sockstat for macOS using libproc

Buy Me A Coffee

sockstat

Download

See releases and Download a precompiled universal binary

Build from sources

You can compile everything from sources. To install sockstat into bin directory under /usr/local, run:

make install clean

If using a custom installation path, define PREFIX:

make install clean PREFIX=/path/to/install

To build a universal binary suitable both for x64 and M-processors:

make universal install clean

To deinstall:

make uninstall

Usage

sockstat-1.0.1

Usage:
    sockstat [-46klNrquh]

    -4  Show AF_INET (IPv4) sockets
    -6  Show AF_INET (IPv6) sockets
    -k  Show AF_SYSTEM (Kernel) sockets
    -n  Show AF_NDRV sockets
    -r  Show AF_ROUTE sockets
    -u  Show AF_LOCAL (UNIX) sockets

    -l  Show only LISTENing sockets
    -q  Quiet mode - suppress header

    -h  This help message

Run sockstat as root to see all sockets

Performance

I do not think, performance plays here any role, but anywhy: the same good old MacBook Air late 2015, idle state. Graphs lsof vs sockstat - the lower, the better.

lsof sockstat

If you have an idea, a question, or found a problem, do not hesitate to open an issue or mail me: Mikhail Zakharov zmey20000@yahoo.com