Skip to content

akme/lsofgraph-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python version of zevv/lsofgraph

A small utility to convert Unix lsof output to a graph showing FIFO and UNIX interprocess communication.

Generate graph:

sudo lsof -n -F | python lsofgraph.py | dot -Tjpg > /tmp/a.jpg
    OR
sudo lsof -n -F | python lsofgraph.py | dot -T svg > /tmp/a.svg

or add unflatten to the chain for a better layout:

sudo lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T jpg > /tmp/a.jpg
    OR
sudo lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T svg > /tmp/a.svg

example output

Install and use on MacOS

Graphviz contains utilities dot and unflatten

brew install Graphviz
git clone https://github.com/akme/lsofgraph-python.git
cd lsofgraph-python
lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T jpg > /tmp/a.jpg && open /tmp/a.jpg
lsof -n -F | python lsofgraph.py | unflatten -l 1 -c 6 | dot -T svg > /tmp/a.jpg && open -a Safari.app '/tmp/a.svg'

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages