Navigation

realpath

Resolves a path to an absolute canonical path.

realpath expands relative paths and symlinks so you can see the final absolute location a path points to.

Syntax
realpath [options] path...

Arguments explained

  • path is the file or directory to resolve.
  • -m canonicalizes even if some components do not exist.

Common examples

Resolve a relative path
realpath ../project

Prints the absolute path for ../project.

Resolve a symlink target
realpath /bin/sh

Shows the final target behind the /bin/sh path.

realpath Command
FieldDetails
Commandrealpath
CategoryNavigation
Primary useResolves a path to an absolute canonical path.
Syntaxrealpath [options] path...