WhatUses
A simple, cross-platform CLI tool to identify which processes are using a specific file or listening on a network port.
Features
- 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.
Installation
From Source (using Cargo)
If you have Rust installed, you can install whatuses directly from source:
Binary Downloads
Check the Releases page for pre-compiled binaries for Windows and Linux.
Usage
Check a File
To see which processes are using a specific file:
Or explicitly using the --file flag:
On Linux:
Check a Port
To see which processes are listening on a specific port:
Or explicitly using the --port flag:
Verbose Mode
For more detailed logging:
When 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.
Platform Support
Windows
- 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.
Linux
- 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).
License
This project is licensed under the terms specified in the LICENSE file.