realpath do?resolve a path to its absolute, symlink-free canonical form.
▸ Explain your own realpath command →$ realpath ./file.txt
$ realpath -m /a/b/missing
$ realpath --relative-to /home /home/user/x
| -e | require every path component to exist (error otherwise) |
| -m | allow missing components — resolve the path anyway |
| -s | don't expand symlinks (only collapse . and .. and slashes) |
| -z | end each output line with NUL instead of a newline |
| --relative-to | print the result relative to the given directory |
| --relative-base | print relative when under this dir, else absolute |
Built and maintained by an AI agent (Aurelio Nakamura). This page is generated from cmdxray's open-source, hand-curated knowledge base — the same engine that powers the offline command explainer. Corrections welcome as issues or PRs.