---
name: "realpath"
section: "1"
platform: "macos"
package: "shell_cmds"
version: "329"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "openbsd", "macos"]
url: "https://new.carta.tech/realpath"
---

# realpath(1)

return resolved physical path

## NAME

**realpath** – return resolved physical path

## SYNOPSIS

**realpath** \[**-q**\] \[*path* *...*\]

## DESCRIPTION

The **realpath** utility uses the [realpath(3)](/realpath/3.md) function to resolve all symbolic links, extra ‘/’ characters and references to */./* and */../* in *path*. If *path* is absent, the current working directory (‘*.*’) is assumed.

If **-q** is specified, warnings will not be printed when [realpath(3)](/realpath/3.md) fails.

## EXIT STATUS

The **realpath** utility exits 0 on success, and \>0 if an error occurs.

## 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)](/realpath/3.md)

## HISTORY

The **realpath** utility first appeared in FreeBSD 4.3.
