Forrest logo
back to the realpath tool

realpath:tldr:93908

realpath: Disable symlink expansion.
$ realpath --no-symlinks ${filename_or_directory}
try on your machine

The command "realpath --no-symlinks ${filename_or_directory}" is used to retrieve the absolute (full) path of a file or directory without following any symbolic links (symlinks) present in the path.

Let's break down the command:

  • "realpath" is a command-line tool that resolves the symbolic links and returns the absolute path of a file or directory.
  • "--no-symlinks" is an option or flag passed to the "realpath" command. It instructs the command not to follow any symbolic links found in the path.
  • "${filename_or_directory}" is a placeholder that represents the file or directory whose absolute path you want to obtain. You need to replace it with the actual name or path of the file or directory.

By using this command, you can retrieve the real (non-symbolic) absolute path of the specified file or directory.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the realpath tool