ディレクトリエントリを検索するには、ldapsearch(1) を使用します。ldapsearch は、LDAP ディレクトリサーバーへの接続を開き、そのディレクトリサーバーにバインドして、ディレクトリの検索を実行します。
米国の Ultra Keyboards 社に勤務する、IEEE のメンバーを検索します。
% ldapsearch -L -b "o=IEEE, o=Ultra Keyboards Inc., c=US" uid=\* |
検索結果は次のようになります。
dn: uid=jqwerty, o=IEEE, o=Ultra keyboards Inc., c=US
uid: jqwerty
cn: jqwerty
userpassword: {crypt}somecryptedtext
uidnumber: 12345
gidnumber: 123
gecos: Joseph Qwerty
homedirectory: /home/jqwerty
loginshell: /bin/csh
objectclass: top
objectclass: shadowAccount
objectclass: account
objectclass: posixAccount
shadowlastchange: 3455
dn: uid=bhand, o=IEEE, o=Ultra keyboards Inc., c=US
uid: bhand
cn: bhand
userpassword: {crypt}somecryptedtext
uidnumber: 12347
gidnumber: 123
gecos: William Handset
homedirectory: /home/bhand
loginshell: /bin/csh
objectclass: top
objectclass: shadowAccount
objectclass: account
objectclass: posixAccount
shadowlastchange: 3440
|