REALPATH(1)

NAME
realpath - print the resolved path

SYNOPSIS
realpath [OPTION...] [path...]

DESCRIPTION
The realpath utility resolve all symbolic links, extra ‘/’ characters and references to /./ and /../ in path. If path is absent, the current working directory (‘~’). is assumed.

By default, all components of path must exist.

The options are as follows:

-f, --canonicalize-existing
    All components must exist. This is the default behavior.

-m, --canonicalize-missing
    No component of the path must exist. It is resolved up until the first component that exists and a normalized path is printed.

-s, --strip, --no-symlinks
    The path is normalized logically, without resolving any symlinks.

--relative-to DIR
    Print result relative to DIR.

-q, --quiet
    Most error messages are suppressed. The return failure code is still issued.

-z, --zero
    By default, newlines are used to end each output line. With this flag, NUL is used instead.

--help
    Display a help message and exit.

--version
    Display version information and exit.

EXIT STATUS

EXAMPLES
Show the physical path of the /dev/log directory silencing warnings if any:

    $ realpath -q /dev/log
    /var/run/log

SEE ALSO
realpath(3)

HISTORY
The realpath utility first appeared in FreeBSD 4.3. This implementation is a part of chimerautils and was written from scratch.