豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Latest commit

 

History

History
25 lines (16 loc) · 351 Bytes

File metadata and controls

25 lines (16 loc) · 351 Bytes

realpath

realpath package on Ubuntu.

Resolve all symbolic links and . and .. entries of a path recursively.

Prefer readlink which is more widespread by default in distros.

mkdir a
ln -s a b
cd a
touch a
ln -s a b
cd ..
realpath ./b/b

Output:

= "`pwd`/a/a"

readlink -f

Same as:

readlink ./b/b