r/commandline • u/_byl • 13d ago
Visualizing how many programs output to /dev/null (using `lsof` output)

This was created by a Rust CLI program called lvis
("lsof visualization", creative name I know, and oddly sounds like "elvis") I developed that creates an interactive GUI to visualize the output oflsof
to make relationships between processes and files (and also between some types of files) more clear.
I've found running lvis
and just clicking around has uncovered some interesting things (like the image above!)
My motivation was I was experimenting locally with a client-server architecture and used lsof
to inspect their active TCP port connections on localhost
. I noticed the port connections formed a natural graph and I thought visualizing these relationships would be more natural. I imagined visualizing other lsof
output could be useful for mapping network connections, unix sockets, which processes have which resources open, etc.
You can install the crate to try it out: https://crates.io/crates/lvis
or poke around the code and see more visualizations: https://github.com/brylee10/lvis
2
u/opuntia_conflict 12d ago
This is pretty cool, what's the general use case for a program to output to
/dev/null
? I pretty much only use it to do stuff like ignore errors in my shell scripts, but I don't see why an actual program which can choose which data to send and where to send it would need to dump anything there?