Resolve a path to its absolute form
low risk
Prints the absolute canonical path, resolving symlinks and .. components.
| Flag | Meaning |
|---|---|
-s | Do not resolve symlinks |
-m | Allow missing path components |
--relative-to --relative-to | Print path relative to a directory |
realpath ./script.shAbsolute path of a file · explain & risk-check →realpath --relative-to=/etc /etc/ssh/sshd_configssh/sshd_config · explain & risk-check →Reference text is hand-written and may be incomplete — check man realpath for your version. Test destructive commands on a non-production system first.