i can find all link in dir by command:
find . -type l
But i need link which only refer to files outside of PWD.
Can anybody say how to do it?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I would do something like:
readlink -fgives you the canonical path of a file, so the first command gives you the path of links and thegrepcommand excludes files beginning with the current path.If you want to remember which links pointed to those paths, here’s a way to do it:
the
-execswitch is more complicated since you have to display both the linked path and the path of the symlink.