whatuses

Crates.iowhatuses
lib.rswhatuses
version0.2.2
created_at2025-12-30 22:20:43.249504+00
updated_at2025-12-30 22:38:37.430388+00
descriptionA simple CLI tool to find which process is using a file or port
homepagehttps://github.com/kaskii/whatuses
repositoryhttps://github.com/kaskii/whatuses
max_upload_size
id2013495
size32,265
Alexander Elo (kaskii)

documentation

README

WhatUses

A simple, cross-platform CLI tool to identify which processes are using a specific file or listening on a network port.

Crates.io License

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:

cargo install whatuses

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:

whatuses C:\path\to\your\file.txt

Or explicitly using the --file flag:

whatuses --file C:\path\to\your\file.txt

On Linux:

whatuses /path/to/your/file.txt

Check a Port

To see which processes are listening on a specific port:

whatuses 8080

Or explicitly using the --port flag:

whatuses --port 3000

Verbose Mode

For more detailed logging:

whatuses 8080 --verbose

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.exe on 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-esr to map ports to PIDs.

Linux

  • Files: Inspects /proc/[pid]/fd to 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.

Commit count: 0

cargo fmt