360 Secure SkillHub
360 安全技能中心

Realpath Tool

该 Skill 提供 realpath-tool 命令行用法,把相对路径和符号链接转换为绝对规范路径;支持 -s 保留逻辑路径、-m 允许路径不存在、--relative-to 输出相对指定目录的路径。仓库内含 scripts/realpath.py,运行环境涉及 bash、python3 与 realpath 二进制,未声明网络调用或外部服务。

dinghaibin
dinghaibin
热度 29.94
最近更新 2026-05-11 17:47:01
分类:效率依赖:代码执行 / 读写文件应用场景:工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add realpath-tool
Metadata
name
realpath-tool
description
Resolve relative paths and symbolic links to absolute canonical paths. Use for getting the full, unambiguous file path.

Realpath - Absolute Path Resolver

Convert relative paths and symlinks to absolute canonical paths. Useful for scripts that need the full path of files, directories, or symlinked resources.

Usage

realpath-tool [options] <path...>

Options

  • -s: Don't expand symlinks (show logical path)
  • -m: Path doesn't need to exist
  • --relative-to=DIR: Show path relative to DIR

Examples

realpath-tool ./relative/path
realpath-tool -s symlink_path
realpath-tool --relative-to=/home file.txt