Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As title. How can I see a list of symbolic links in the format A -> B starting from a specified directory including all it's sub directories?

This is on a Mac by the way.

share|improve this question

migrated from stackoverflow.com Apr 1 '13 at 18:03

This question came from our site for professional and enthusiast programmers.

2 Answers 2

find . -type l -exec stat -f '%N -> %Y' {} \+

%N = name, %Y = target of symbolic link.

share|improve this answer

Running

ls -l `find . -xtype l `

while you are in the directory should do the trick. Else, replace . with the directory name. Do man find to set additional options if you like.

share|improve this answer
1  
BSD find doesn't have -xtype, and this doesn't work if the paths have spaces. –  ؘؘؘؘ Apr 1 '13 at 21:22
    
@LauriRanta - sorry, I was away from my Mac and tested this on Linux. Thanks for your more thorough answer! –  MattDMo Apr 1 '13 at 21:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.