Command-line tool
lsof
brew/lsof
Checked 25 Oct 2026, 21:09 UTC · Listing refreshed from Homebrew, winget, npm, Scoop and cargo; npm packages checked against OSV.dev
Utility to list open files
At a glance
- Type
- Command-line tool
- Install on
- macOS, Linux
- Last checked
- 25 Oct 2026, 21:09 UTC
Install it
macOS
brew install lsof
Linux
brew install lsof
Find the processes that have a given file open
lsof path/to/file
Find the process that opened a local internet port
lsof -i :port
Only output the process ID (PID)
lsof -t path/to/file
Related command-line tools
- peazip
A free file archiver utility, based on Open Source technologies - woff2
Utilities to create and convert Web Open Font File (WOFF) files - argus
Audit Record Generation and Utilization System server - lr
File list utility with features from ls(1), find(1), stat(1), and du(1) - dalfox
XSS scanner and utility focused on automation - Winix WhoHolds
Winix WhoHolds (Windows package; no description in the winget index) developer-tools cli portable process port-scanner… - pax
Portable Archive Interchange archive tool - unreferenced_files
A utility for finding unused and unreferenced files.
Listing text is written by the maker; AptLynx lists tools and does not vouch for them. Find another tool · Browse by topic · For agents