How can I use find to search for symbolic links?

This is what I have:

abc:~/findtests$ ls -l  
total 0  
lrwxrwxrwx 1 abc abc 22 2010-11-30 14:32 link1 -> /home/abc/  

I am trying to search for the link link1 in the current directory.

I did :

abc:~/findtests$ find -L . -lname 'link1'
abc:~/findtests$ find -P . -lname 'link1'
abc:~/findtests$ find -L . -lname 'test*'
abc:~/findtests$ find -P . -lname 'test*'

But could not get any output. What am I doing wrong ?


To start with, from the man page:

"Using -L causes the -lname and -ilname predicates always to return false."

The target of the symbolic link doesn't match 'test*' because there is the full path. Try '*/test*'.

Need Your Help

Objective-C – Background threading with GCD and NSURLConnection

objective-c asynchronous nsurlconnection grand-central-dispatch

As I understand methods named *WithContentsOfURL: like [NSData dataWithContentsOfURL:] are synchronous.

ng-options and ng-bind not working with objects and strings

angularjs ng-options

I have a drop down bound to ng-options (which uses an array of objects)

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.