realpath
FilesFundamentals In simulator In real LinuxPrint the resolved absolute path
Name: realpath: the real path
You can practise it right away in the simulator, and use it in real Linux mode too.
Description
realpath prints the canonical absolute path of a file: relative paths become absolute, . and .. are removed and symbolic links are resolved.
Syntax
realpath [OPTION]... FILE...Common options
| -s / --strip / --no-symlinks | Don't resolve symlinks |
| -e / --canonicalize-existing | Every part of the path must exist |
| -m / --canonicalize-missing | Work out the path even if parts of it do not exist |
| --relative-to DIR | Print the path relative to DIR |
Examples
$ realpath ../notes.txt
Turn a relative path into an absolute one
Explain