2018-10-01 17:36:30 +01:00
|
|
|
# realpath
|
|
|
|
|
|
|
|
> Display the resolved absolute path for a file or directory.
|
2025-01-18 18:45:33 +05:30
|
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/realpath-invocation.html>.
|
2018-10-01 17:36:30 +01:00
|
|
|
|
|
|
|
- Display the absolute path for a file or directory:
|
|
|
|
|
|
|
|
`realpath {{path/to/file_or_directory}}`
|
|
|
|
|
|
|
|
- Require all path components to exist:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`realpath {{[-e|--canonicalize-existing]}} {{path/to/file_or_directory}}`
|
2018-10-01 17:36:30 +01:00
|
|
|
|
|
|
|
- Resolve ".." components before symlinks:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`realpath {{[-L|--logical]}} {{path/to/file_or_directory}}`
|
2018-10-01 17:36:30 +01:00
|
|
|
|
|
|
|
- Disable symlink expansion:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`realpath {{[-s|--no-symlinks]}} {{path/to/file_or_directory}}`
|
2018-10-01 17:36:30 +01:00
|
|
|
|
|
|
|
- Suppress error messages:
|
|
|
|
|
2025-03-26 02:30:50 +02:00
|
|
|
`realpath {{[-q|--quiet]}} {{path/to/file_or_directory}}`
|