realpath
Installation
SKILL.md
Cross-Platform Path Operations with realpath
Platform Rule (CRITICAL)
| Platform | Command | Notes |
|---|---|---|
| macOS | grealpath |
Requires GNU coreutils (brew install coreutils). See macos-cli-rules for full GNU coreutils usage. |
| Linux | realpath |
Available by default in GNU/Linux. |
All examples below use realpath. On macOS, replace every realpath with grealpath.
When to Use
ALWAYS use realpath for:
- Calculating relative paths between files/directories
- Converting relative paths to absolute paths
- Resolving symbolic links to absolute paths
Related skills