Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ansilithic/path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

19 Commits

Repository files navigation

path

Inspect PATH entries -- where each directory came from, what executables it contains, and what's shadowing what.

How it works

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.

Install

brew install ansilithic/tap/path

Or build from source (requires Xcode and macOS 14+):

make build && make install

Usage

USAGE: path [--list] [--shadows] [--dir ]

OPTIONS:
-l, --list List executables in each directory
-s, --shadows Show only shadowed executables (implies --list)
--dir Filter to a specific directory
--version Show the version
-h, --help Show help information

Examples

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 directory

License

MIT

About

Trace PATH entries to their source config files with shadow detection and binary classification.

Topics

Resources

Readme

License

MIT license

Stars

Watchers

Forks

Packages

Contributors