A simple, cross-platform CLI tool to identify which processes are using a specific file or listening on a network port.
- File Investigation: Find which processes have a specific file open.
- Port Investigation: Identify processes listening on a specific TCP/UDP port.
- Cross-Platform: Supports Windows and Linux.
- Detailed Output: Provides PID, process name, and executable path.
If you have Rust installed, you can install whatuses directly from source:
cargo install whatusesCheck the Releases page for pre-compiled binaries for Windows and Linux.
To see which processes are using a specific file:
whatuses C:\path\to\your\file.txtOr explicitly using the --file flag:
whatuses --file C:\path\to\your\file.txtOn Linux:
whatuses /path/to/your/file.txtTo see which processes are listening on a specific port:
whatuses 8080Or explicitly using the --port flag:
whatuses --port 3000For more detailed logging:
whatuses 8080 --verboseWhen enabled, verbose mode provides additional insights into the tool's operations, including:
- Path Resolution: Shows how file paths are being canonicalized.
- Search Progress: Displays the number of active sockets or processes being scanned.
- Detailed Matches: Shows protocol and address information for matching network sockets.
- Internal Lookups: Logs attempts to resolve executable paths using platform-specific APIs or fallbacks (e.g., for
svchost.exeon Windows). - System Activity: Indicates when the internal process list is being refreshed.
- Files: Uses the Windows Restart Manager API to accurately identify processes holding file locks.
- Ports: Uses native Windows APIs via
netstat-esrto map ports to PIDs.
- Files: Inspects
/proc/[pid]/fdto find processes with open file descriptors. - Ports: Parses network information to identify listening processes.
Note: On both platforms, some process information may require elevated privileges to access. If the tool does not find any processes when you expect it should, try running it with sudo (Linux) or as Administrator (Windows).
This project is licensed under the terms specified in the LICENSE file.