I can show the target file that a link points to using 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
Is there a way to show less output without having to pipe through another command such as awk? E.g:
snowch$ ls ?? /usr/local/bin/mvn
/usr/local/bin/mvn -> ../Cellar/maven/3.2.3/bin/mvn
I'm running 3.2.53 on OS X 10.9.5. The output from several commands is shown below:
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
worked great. Thanks! – Chris Snow Dec 12 '14 at 10:51stat -c %N -- /usr/local/bin/mvn
. To remove the quotations I had to pipe this into| perl -pe 's/['"'"'\
]//g'` – cfi Aug 31 '16 at 09:00tr -d \'\\`` would be enough. Note that that RHEL system would have GNU
find` with which you'll have more control over. – Stéphane Chazelas Aug 31 '16 at 09:26