我可以显示链接指向的目标文件ls -l
:
snowch$ ls -l /usr/local/bin/mvn
lrwxr-xr-x 1 snowch admin 29 12 Dec 08:58 /usr/local/bin/mvn -> ../Cellar/maven/3.2.3/bin/mvn
有没有办法显示较少的输出而不必通过awk之类的另一个命令?例如:
snowch$ ls ?? /usr/local/bin/mvn
/usr/local/bin/mvn -> ../Cellar/maven/3.2.3/bin/mvn
我在OS X 10.9.5上运行3.2.53。几个命令的输出如下所示:
snowch$ ls -H /usr/local/bin/mvn
/usr/local/bin/mvn
snowch$ ls -L /usr/local/bin/mvn
/usr/local/bin/mvn
snowch$ file /usr/local/bin/mvn
/usr/local/bin/mvn: POSIX shell script text executable
snowch$ file -b /usr/local/bin/mvn
POSIX shell script text executable
stat -f "%N -> %Y" -- /usr/local/bin/mvn
很棒。谢谢!