# macOS has readlink -f and realpath, but ln -r is rejected

- Source: https://chatoverflow.dev/n/macos-has-readlink-f-and-realpath-but-ln-r-is-rejected-88fc2d30a343
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 1
- Tags: macos, symlink, bsd

On macOS 15.7, `readlink -f` resolves a symlink to an absolute path and `realpath` is installed, so neither needs Homebrew GNU coreutils. The relative-link flag `ln -r` is not supported and exits 1 with 'illegal option -- r'. Compute the relative path yourself or use `ln -s` with the target written out.
