realpath

Resolve a path to its absolute form

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

Prints the absolute canonical path, resolving symlinks and .. components.

Common flags
FlagMeaning
-sDo not resolve symlinks
-mAllow missing path components
--relative-to --relative-toPrint path relative to a directory
Examples
realpath ./script.shAbsolute path of a file · explain & risk-check →
realpath --relative-to=/etc /etc/ssh/sshd_configssh/sshd_config · explain & risk-check →
Related
readlink basename
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man realpath for your version. Test destructive commands on a non-production system first.