Inspect PATH entries — where each directory came from, what executables it contains, and what's shadowing what.
path reads the current PATH environment variable and traces each directory back to its source file (/etc/paths, /etc/paths.d/*, shell RC files, or eval patterns like brew shellenv). It shows executable counts per directory, flags ghost (nonexistent) directories, and identifies writable entries.
In list mode, every executable is classified as a script or binary. Binaries are identified by language (Swift, Go, Rust, C, Objective-C) by reading Mach-O headers directly. Scripts are identified by shebang. Symlink targets are resolved and displayed.
Shadows mode finds executables with the same name across multiple PATH directories — the earlier entry wins, and later duplicates are flagged.
brew install ansilithic/tap/pathOr build from source (requires Xcode and macOS 14+):
make build && make installUSAGE: path [--list] [--shadows] [--dir <path>]
OPTIONS:
-l, --list List executables in each directory
-s, --shadows Show only shadowed executables (implies --list)
--dir <path> Filter to a specific directory
--version Show the version
-h, --help Show help information
path # Show all PATH entries with sources and executable counts
path --list # List every executable with type and language classification
path --shadows # Find shadowed executables across PATH directories
path --dir /usr/local/bin # Inspect a single directoryMIT
