Skip to content


Retrieves metadata about a path on the remote machine.

distant fs metadata /path/to/file.txt


  • --canonicalize: resolves relative paths and evaluate and follow symlinks to determine the absolute path to the underlying file or directory.
  • --resolve-file-type: changes the returned file type from symlinks to the underlying file or directory types. If not provided, this will report the type of the immediate path.


  • Relative paths resolve to the current working directory of the server.
distant fs metadata --help
Retrieves metadata for the specified path on the remote machine

Usage: distant fs metadata [OPTIONS] <PATH>

  <PATH>  The path to the file, directory, or symlink on the remote machine

      --cache <CACHE>                Location to store cached data [default: /home/runner/.cache/distant/cache.toml]
      --log-level <LOG_LEVEL>        Log level to use throughout the application [possible values: off, error, warn, info, debug, trace]
      --connection <CONNECTION>      Specify a connection being managed
      --log-file <LOG_FILE>          Path to file to use for logging
      --config <CONFIG_PATH>         Configuration file to load instead of the default paths
      --unix-socket <UNIX_SOCKET>    Override the path to the Unix socket used by the manager (unix-only)
      --windows-pipe <WINDOWS_PIPE>  Override the name of the local named Windows pipe used by the manager (windows-only)
      --canonicalize                 Whether or not to include a canonicalized version of the path, meaning returning the canonical, absolute form of a path with all intermediate components normalized and symbolic links resolved
      --resolve-file-type            Whether or not to follow symlinks to determine absolute file type (dir/file)
  -h, --help                         Print help