commands
realpath — resolve an absolute canonical path
GNU realpath resolves path components and symbolic links. -e requires all components to exist. Canonicalization is not a security boundary because filesystem state can change. Examples assume a fresh chapter files lab.
Formal Syntax & Structure
linux syntaxlinux
realpath [OPTION]... FILE...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -e | option | Require all components to exist |
| FILE | operand | Path to resolve |
Return Value
text and exit status
GNU realpath prints a canonical absolute path; -e requires all components to exist. An unresolved required component yields nonzero status. A successful resolution is only a point-in-time observation.
Working Example
Example Snippetlinux
realpath -e notes/hello.txt