# lsof

9 Hacker News commenters recommended lsof and 5 criticized it, November 2025 to November 2026. It was recommended in 7 of 13 months.

**Verdict:** Recommended for finding which process holds a port or file open without restarting anything. Critics find its flags and defaults awkward, and warn against killing its results.

## Why people recommend it

- Finds processes using ports or files (5 comments): "I just needed a simple alias local-tcp-listeners='lsof -iTCP -sTCP:LISTEN' in my ~/.bash_aliases" ([source](https://news.ycombinator.com/item?id=47453584)) "that's your clue to run lsof and look for "deleted" files that are open." ([source](https://news.ycombinator.com/item?id=47678154)) "the quickest way to find the culprit without restarting anything" ([source](https://news.ycombinator.com/item?id=47682343))
- Useful for troubleshooting (2 comments): "some of the most often misunderstood or unknown tools that I find useful for troubleshooting" ([source](https://news.ycombinator.com/item?id=49920837)) "Tools such as strace, eBPF, lsof, ss, etc. have tremendous value." ([source](https://news.ycombinator.com/item?id=50039674))

## What people warn about

- Awkward flags and defaults (2 comments): "I kept running variations of lsof -i | grep LISTEN and then forgetting the flags the next time" ([source](https://news.ycombinator.com/item?id=46959396)) "it's weird that both lsof and ss defaults are so awful" ([source](https://news.ycombinator.com/item?id=46363327))

## Alternatives hackers recommend

- [fzf](https://hackerapproved.com/p/fzf.md): 78 recommend
- [jq](https://hackerapproved.com/p/jq.md): 75 recommend
- [grep](https://hackerapproved.com/p/grep.md): 65 recommend
- [Atuin](https://hackerapproved.com/p/atuin.md): 63 recommend
- [GitHub CLI](https://hackerapproved.com/p/github-cli.md): 49 recommend

## Cite as

Hacker Approved, "lsof", https://hackerapproved.com/p/lsof/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
