readlink,从字面意思就可以看出来,输出符号链接值或者权威文件名。
openwrt 下的readlink命令参数如下:
[email protected]:/# readlink --help
BusyBox v1.22.1 (2016-05-16 12:27:19 CST) multi-call binary.
Usage: readlink [-fnv] FILE
Display the value of a symlink
-f Canonicalize by following all symlinks
选项可以递归跟随给出文件名的所有符号链接以标准化,除最后一个外所有组件必须存在。
简单地说,就是一直跟随符号链接,直到直到非符号链接的文件位置,限制是最后必须存在一个非符号链接的文件。
-n Don‘t add newline
-v Verbose
[email protected]:/#
直接查看:
[email protected]:/# readlink /etc/rc.d/S50snmpd
../init.d/snmpd
[email protected]:/#
[email protected]:/# readlink -n /etc/rc.d/S50snmpd
../init.d/snmpd [email protected]:/#
[email protected]:/#
[email protected]:/# readlink -v /etc/rc.d/S50snmpd
../init.d/snmpd
[email protected]:/#
[email protected]:/# readlink -f /etc/rc.d/S50snmpd
/etc/init.d/snmpd
[email protected]:/#