summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/ldapsearch.1
blob: 91571c81bdfe19c956bc1d86c415122482e110aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
'\" te
.\" Copyright (C) 1990, Regents of the University of Michigan.  All Rights Reserved.
.\" Portions Copyright (C) 2006, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH LDAPSEARCH 1 "Jan 6, 2006"
.SH NAME
ldapsearch \- ldap search tool
.SH SYNOPSIS
.LP
.nf
\fBldapsearch\fR [\fB-n\fR] [\fB-u\fR] [\fB-v\fR] [\fB-t\fR] [\fB-A\fR] [\fB-B\fR] [\fB-L\fR] [\fB-R\fR] [\fB-H\fR]
     [\fB-?\fR] [\fB-t\fR] [\fB-T\fR] [\fB-B\fR] [\fB-E\fR] [\fB-J\fR] [\fB-e\fR] [\fB-l\fR] [\fB-Z\fR] [\fB-r\fR]
     [\fB-M\fR] [\fB-d\fR \fIdebuglevel\fR] [\fB-F\fR \fIsep\fR] [\fB-f\fR \fIfile\fR] [\fB-D\fR \fIbindDN\fR]
     [\fB-j\fR \fIfilename\fR] [\fB-V\fR \fIversion\fR] [\fB-Y\fR \fIproxyDN\fR] [\fB-O\fR \fIhopLimit\fR]
     [\fB-i\fR \fIlocale\fR] [\fB-k\fR \fIpath\fR] [\fB-S\fR [\fB-\fR] \fIattribute\fR] [\fB-C\fR \fIpattern\fR]
     [\fB-c\fR \fIauthzid\fR] [\fB-P\fR \fIpath\fR] [\fB-N\fR \fIcertificate\fR] [\fB-w\fR \fIpasswd\fR]
     [\fB-h\fR \fIldaphost\fR] [\fB-p\fR \fIldapport\fR] [\fB-o\fR \fIattributename\fR=\fIvalue\fR]
     [\fB-b\fR \fIsearchbase\fR] [\fB-s\fR \fIscope\fR] [\fB-a\fR \fIderef\fR] [\fB-l\fR \fItimelimit\fR]
     [\fB-z\fR \fIsizelimit\fR] \fIfilter\fR [\fIattrs\fR]...
.fi

.SH DESCRIPTION
.sp
.LP
The \fBldapsearch\fR utility opens a connection to an LDAP server, binds, and
performs a search using the filter \fIfilter\fR.
.sp
.LP
If \fBldapsearch\fR finds one or more entries, the attributes specified by
\fIattrs\fR are retrieved and the entries and values are printed to standard
output. If no \fIattrs\fR are listed, all attributes are returned.
.SS "Output Format"
.sp
.LP
If one or more entries are found, each entry is written to standard output in
the form:
.sp
.in +2
.nf
dn: Distinguished Name (DN)
        attributename: value
        attributename: value
        attributename: value
\&...
.fi
.in -2
.sp

.sp
.LP
Multiple entries are separated with a single blank line. If the \fB-F\fR option
is used to specify a different separator character, this character is used
instead of the \fB:\fR character. If the \fB-t\fR option is used, the name of a
temporary file is returned in place of the actual value. If the \fB-A\fR option
is given, only the "attributename" is returned and not the attribute value.
.SH OPTIONS
.sp
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-A\fR\fR
.ad
.sp .6
.RS 4n
Retrieve attributes only (no values). This is useful when you just want to see
whether an attribute is present in an entry and are not interested in the
specific value.
.RE

.sp
.ne 2
.na
\fB\fB-a\fR \fIderef\fR\fR
.ad
.sp .6
.RS 4n
Specify how aliases dereferencing is done. The possible values for \fIderef\fR
are \fBnever\fR, \fBalways\fR, \fBsearch\fR, or \fBfind\fR to specify
respectively that aliases are never dereferenced, always dereferenced,
dereferenced when searching, or dereferenced only when finding the base object
for the search. The default is to never dereference aliases.
.RE

.sp
.ne 2
.na
\fB\fB-B\fR\fR
.ad
.sp .6
.RS 4n
Display non-ASCII values and use the old non-LDIF format. This option disables
the default \fB-L\fR option.
.RE

.sp
.ne 2
.na
\fB\fB-b\fR \fIsearchbase\fR\fR
.ad
.sp .6
.RS 4n
Use \fIsearchbase\fR as the starting point for the search instead of the
default.
.RE

.sp
.ne 2
.na
\fB\fB-C\fR \fIpattern\fR\fR
.ad
.sp .6
.RS 4n
Persistent search. Perform a search that keeps the connection open and displays
results whenever entries matching the scope and filter of the search are added,
modified, or removed. With this option, the \fBldapsearch\fR tool runs
indefinitely; you must type Control-c to stop it. The pattern has the following
format:
.sp
.in +2
.nf
ps:changeType[:changesOnly[:entryChangeControls]]
.fi
.in -2
.sp

.RE

.sp
.ne 2
.na
\fB\fB-c\fR \fIauthzid\fR\fR
.ad
.sp .6
.RS 4n
Specifies the \fBgetEffectiveRights\fR control \fIauthzid\fR. For example:
.sp
.in +2
.nf
dn:uid=bjensen,dc=example,dc=com
.fi
.in -2
.sp

.RE

.sp
.ne 2
.na
\fB\fB-D\fR \fIbindDN\fR\fR
.ad
.sp .6
.RS 4n
Use the distinguished name \fIbindDN\fR to bind to the directory.
.RE

.sp
.ne 2
.na
\fB\fB-d\fR \fIdebuglevel\fR\fR
.ad
.sp .6
.RS 4n
Set the \fBLDAP\fR debugging level. Useful levels of debugging for
\fBldapsearch\fR are:
.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 7n
Trace
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 7n
Packets
.RE

.sp
.ne 2
.na
\fB\fB4\fR\fR
.ad
.RS 7n
Arguments
.RE

.sp
.ne 2
.na
\fB\fB32\fR\fR
.ad
.RS 7n
Filters
.RE

.sp
.ne 2
.na
\fB\fB128\fR\fR
.ad
.RS 7n
Access control
.RE

To request more than one category of debugging information, add the masks. For
example, to request trace and filter information, specify a debuglevel of 33.
.RE

.sp
.ne 2
.na
\fB\fB-E\fR\fR
.ad
.sp .6
.RS 4n
Ask server to expose (report) bind identity by means of authentication response
control.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR\fR
.ad
.sp .6
.RS 4n
Minimize base-64 encoding of values.
.RE

.sp
.ne 2
.na
\fB\fB-F\fR \fIsep\fR\fR
.ad
.sp .6
.RS 4n
Use \fIsep\fR as the field separator between attribute names and values. If
this option has been specified, the \fB-L\fR option is ignored.
.RE

.sp
.ne 2
.na
\fB\fB-f\fR \fIfile\fR\fR
.ad
.sp .6
.RS 4n
Read a series of lines from \fIfile\fR, performing one \fBLDAP\fR search for
each line. In this case, the \fIfilter\fR given on the command line is treated
as a pattern where the first occurrence of \fB%s\fR is replaced with a line
from \fIfile\fR. If \fIfile\fR is a single \fI-\fR character, then the lines
are read from standard input.
.RE

.sp
.ne 2
.na
\fB\fB-G\fR \fIpattern\fR\fR
.ad
.sp .6
.RS 4n
Virtual list view. Retrieve only a portion of all results, as determined by the
index or value of the search target and the number of entries to be returned
before and after the target. This option always requires the \fB-S\fR and
\fB-x\fR options to specify the sorting order on the server.
.RE

.sp
.ne 2
.na
\fB\fB-?\fR\fR
.ad
.sp .6
.RS 4n
Display the usage help text that briefly describes all options.
.RE

.sp
.ne 2
.na
\fB\fB-H\fR\fR
.ad
.sp .6
.RS 4n
Display the usage help text that briefly describes all options.
.RE

.sp
.ne 2
.na
\fB\fB-h\fR \fIldaphost\fR\fR
.ad
.sp .6
.RS 4n
Specify an alternate host on which the secure LDAP server is running.
.RE

.sp
.ne 2
.na
\fB\fB-i\fR \fIlocale\fR\fR
.ad
.sp .6
.RS 4n
Specify the character set to use for command-line input. The default is the
character set specified in the \fBLANG\fR environment variable. You might want
to use this option to perform the conversion from the specified character set
to UTF8, thus overriding the \fBLANG\fR setting. Using this argument, you can
input the bind DN, base DN, and the search filter pattern in the specified
character set. The \fBldapsearch\fR tool converts the input from these
arguments before it processes the search request. For example, \fB-i\fR
\fBno\fR indicates that the bind DN, base DN, and search filter are provided in
Norwegian. This argument only affects the command-line input. If you specify a
file containing a search filter (with the \fB-f\fR option), \fBldapsearch\fR
does not convert the data in the file.
.RE

.sp
.ne 2
.na
\fB\fB-j\fR \fIfilename\fR\fR
.ad
.sp .6
.RS 4n
Specify a file containing the password for the bind DN or the password for the
SSL client's key database. To protect the password, use this option in scripts
and place the password in a secure file. This option is mutually exclusive of
the \fB-w\fR and \fB-W\fR options.
.RE

.sp
.ne 2
.na
\fB\fB-J\fR [:\fIcriticality\fR[:\fIvalue\fR|::\fIb64value\fR|\fIb64value\fR|:\fIfileurl\fR]]\fR
.ad
.sp .6
.RS 4n
Criticality is a boolean value (default is \fBfalse\fR).
.RE

.sp
.ne 2
.na
\fB\fB-k\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Specify the path to a directory containing conversion routines. These routines
are used if you want to specify a locale that is not supported by default by
your directory server. This is for NLS support.
.RE

.sp
.ne 2
.na
\fB\fB-L\fR\fR
.ad
.sp .6
.RS 4n
 Display search results in LDIF format. This option also turns on the \fB-B\fR
option. This behavior is the default.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR \fItimelimit\fR\fR
.ad
.sp .6
.RS 4n
Wait at most \fItimelimit\fR seconds for a search to complete.
.RE

.sp
.ne 2
.na
\fB\fB-M\fR\fR
.ad
.sp .6
.RS 4n
Manage smart referrals. When they are the target of the operation, search the
entry containing the referral instead of the entry obtained by following the
referral.
.RE

.sp
.ne 2
.na
\fB\fB-N\fR \fIcertificate\fR\fR
.ad
.sp .6
.RS 4n
Specify the certificate name to use for certificate-based client
authentication. For example: \fB-N\fR \fB"Directory-Cert"\fR\&.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.sp .6
.RS 4n
Show what would be done, but do not actually perform the search. Useful in
conjunction with \fB-v\fR and \fB-d\fR for debugging.
.RE

.sp
.ne 2
.na
\fB\fB-O\fR \fIhopLimit\fR\fR
.ad
.sp .6
.RS 4n
Specify the maximum number of referral hops to follow while finding an entry to
modify. By default, there is no limit.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIattributename\fR=\fIvalue\fR\fR
.ad
.sp .6
.RS 4n
For SASL mechanisms and other options such as security properties, mode of
operation, authorization ID, authentication ID, and so forth.
.sp
The different attribute names and their values are as follows:
.sp
.ne 2
.na
\fB\fBsecProp\fR=\fI"number"\fR\fR
.ad
.RS 20n
For defining SASL security properties.
.RE

.sp
.ne 2
.na
\fB\fBrealm\fR=\fI"value"\fR\fR
.ad
.RS 20n
Specifies SASL realm (default is \fBrealm=none\fR).
.RE

.sp
.ne 2
.na
\fB\fBauthzid\fR=\fI"value"\fR\fR
.ad
.RS 20n
Specify the authorization ID name for SASL bind.
.RE

.sp
.ne 2
.na
\fB\fBauthid\fR=\fI"value"\fR\fR
.ad
.RS 20n
Specify the authentication ID for SASL bind.
.RE

.sp
.ne 2
.na
\fB\fBmech\fR=\fI"value"\fR\fR
.ad
.RS 20n
Specifies the various SASL mechanisms.
.RE

.RE

.sp
.ne 2
.na
\fB\fB-P\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Specify the path and filename of the client's certificate database. For
example:
.sp
.in +2
.nf
-P /home/uid/.netscape/cert7.db
.fi
.in -2
.sp

When using the command on the same host as the directory server, you can use
the server's own certificate database. For example:
.sp
.in +2
.nf
-P \fIinstallDir\fR/lapd-serverID/alias/cert7.db
.fi
.in -2
.sp

Use the \fB-P\fR option alone to specify server authentication only.
.RE

.sp
.ne 2
.na
\fB\fB-p\fR \fIldapport\fR\fR
.ad
.sp .6
.RS 4n
Specify an alternate TCP port where the secure LAPD server is listening.
.RE

.sp
.ne 2
.na
\fB\fB-R\fR\fR
.ad
.sp .6
.RS 4n
Do not automatically follow referrals returned while searching.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.sp .6
.RS 4n
Display the output of the \fBldapsearch\fR command in the old format.
.RE

.sp
.ne 2
.na
\fB\fB-S\fR [-]\fIattribute\fR\fR
.ad
.sp .6
.RS 4n
Specify an attribute for sorting the entries returned by the search. The sort
criteria is alphabetical on the attribute's value or reverse alphabetical with
the form \fB-attribute\fR. You can give multiple \fB-S\fR options to refine the
sorting, For example:
.sp
.in +2
.nf
-S sn -S \fIgivenname\fR
.fi
.in -2
.sp

By default, the entries are not sorted. Use the \fB-x\fR option to perform
server-side sorting.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR \fIscope\fR\fR
.ad
.sp .6
.RS 4n
Specify the scope of the search. The possible values of \fIscope\fR are
\fBbase\fR, \fBone\fR, or \fBsub\fR to specify respectively a base object,
one-level, or subtree search. The default is \fBsub\fR.
.RE

.sp
.ne 2
.na
\fB\fB-T\fR\fR
.ad
.sp .6
.RS 4n
Format the output of search results so that no line breaks are used within
individual attribute values.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.sp .6
.RS 4n
Write retrieved values to a set of temporary files. This is useful for dealing
with non-ASCII values such as jpegPhoto or audio.
.RE

.sp
.ne 2
.na
\fB\fB-U\fR\fR
.ad
.sp .6
.RS 4n
URL format (valid only with the \fB-t\fR option). When using temporary file
output, the standard output of the tool includes the URL of the file instead of
the attributes value. For example:
.sp
.in +2
.nf
jpegPhoto:< file:/tmp/ldapsearch-jpegPhoto-YzaOMh
.fi
.in -2
.sp

.RE

.sp
.ne 2
.na
\fB\fB-u\fR\fR
.ad
.sp .6
.RS 4n
Include the user-friendly form of the Distinguished Name (DN) in the output.
.RE

.sp
.ne 2
.na
\fB\fB-V\fR \fIversion\fR\fR
.ad
.sp .6
.RS 4n
Specify the LDAP protocol version number to be used for the delete operation,
either 2 or 3. LDAP v3 is the default. Specify LDAP v2 when connecting to
servers that do not support v3.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.sp .6
.RS 4n
Run in verbose mode, with diagnostics written to standard output.
.RE

.sp
.ne 2
.na
\fB\fB-W\fR \fIpassword\fR\fR
.ad
.sp .6
.RS 4n
Specify the password for the client's key database given in the \fB-P\fR
option. This option is required for certificate-based client authentication.
Specifying \fIpassword\fR on the command line has security issues because the
password can be seen by others on the system by means of the \fBps\fR command.
Use the \fB-j\fR instead to specify the password from the file. This option is
mutually exclusive of \fB-j\fR.
.RE

.sp
.ne 2
.na
\fB\fB-w\fR \fIpasswd\fR\fR
.ad
.sp .6
.RS 4n
Use \fIpasswd\fR as the password for authentication to the directory. When you
use \fB-w\fR \fIpasswd\fR to specify the password to be used for
authentication, the password is visible to other users of the system by means
of the \fBps\fR command, in script files or in shell history. If you use the
\fBldapsearch\fR command without this option, the command prompts for the
password and read it from standard in. When used without the \fB-w\fR option,
the password is not visible to other users.
.RE

.sp
.ne 2
.na
\fB\fB-x\fR\fR
.ad
.sp .6
.RS 4n
Use with the \fB-S\fR option to specify that search results be sorted on the
server rather than by the \fBldapsearch\fR command running on the client. This
is useful if you want to sort according to a matching rule, as with an
international search. It is usually faster to sort on the server, if that is
supported, rather than on the client.
.RE

.sp
.ne 2
.na
\fB\fB-Y\fR \fIproxyDN\fR\fR
.ad
.sp .6
.RS 4n
Specify the proxy DN (proxied authorization id) to use for the modify
operation, usually in double quotes (" ") for the shell.
.RE

.sp
.ne 2
.na
\fB\fB-Z\fR\fR
.ad
.sp .6
.RS 4n
Specify that SSL be used to provide certificate-based client authentication.
This option requires the \fB-N\fR and SSL password and any other of the SSL
options needed to identify the certificate and the key database.
.RE

.sp
.ne 2
.na
\fB\fB-z\fR \fIsizelimit\fR\fR
.ad
.sp .6
.RS 4n
Retrieve at most \fIsizelimit\fR entries for a search to complete.
.RE

.SH EXAMPLES
.LP
\fBExample 1 \fRPerforming a Subtree Search
.sp
.LP
The following command performs a subtree search (using the default search base)
for entries with a commonName of "mark smith". The commonName and
telephoneNumber values is retrieved and printed to standard output. Use the
\fB-r\fR option to display this output in the old format.

.sp
.in +2
.nf
example% ldapsearch "cn=mark smith" cn telephoneNumber
.fi
.in -2
.sp

.sp
.LP
The output looks something like this:

.sp
.in +2
.nf
dn: Mark D Smith, ou=Sales, ou=Atlanta, ou=People, o=XYZ, c=US
cn: Mark Smith
cn: Mark David Smith
cn: Mark D Smith 1
cn: Mark D Smith
telephoneNumber: +1 123 456-7890

dn: Mark C Smith, ou=Distribution, ou=Atlanta, ou=People, o=XYZ, c=US
cn: Mark Smith
cn: Mark C Smith 1
cn: Mark C Smith
telephoneNumber: +1 123 456-9999
.fi
.in -2
.sp

.LP
\fBExample 2 \fRPerforming a Subtree Search Using the Default Search Base
.sp
.LP
The following command performs a subtree search using the \fB-r\fR option to
display in old style format with a default search base for entries with user id
of \fBmcs\fR. The user-friendly form of the entry's DN is output after the line
that contains the DN itself, and the \fBjpegPhoto\fR and \fBaudio\fR values are
retrieved and written to temporary files.

.sp
.in +2
.nf
ldapsearch -r -u -t "uid=mcs" -r jpegPhoto audio
.fi
.in -2
.sp

.sp
.LP
The output might look like this if one entry with one value for each of the
requested attributes is found:

.sp
.in +2
.nf
cn=Mark C Smith, ou=Distribution, ou=Atlanta, ou=People, o=XYZ, c=US
Mark C Smith, Distribution, Atlanta, People, XYZ, US
audio=/tmp/ldapsearch-audio-a19924
jpegPhoto=/tmp/ldapsearch-jpegPhoto-a19924
.fi
.in -2
.sp

.LP
\fBExample 3 \fRPerforming a One-Level Search
.sp
.LP
The following command performs a one-level search at the c=US level for all
organizations whose organizationName begins with XY.

.sp
.in +2
.nf
example% ldapsearch -s one -b "c=US" "o=XY*" o description
.fi
.in -2
.sp

.sp
.LP
The \fBorganizationName\fR and \fBdescription\fR attribute values are retrieved
and printed to standard output, resulting in output similar to this:

.sp
.in +2
.nf
dn: o=XYZ    c=US
     o: XYZ
     description: XYZ Corporation

     dn: o="XY Trading Company", c=US
     o: XY Trading Company
     description: Import and export specialists

     dn: o=XYInternational, c=US
     o: XYInternational
     o: XYI
     o: XY International
.fi
.in -2
.sp

.LP
\fBExample 4 \fRPerforming a Subtree Search on an IPv6 Server
.sp
.LP
The following command performs a subtree search using the default search base
for entries with a user id of \fBmcs\fR on an IPv6 (that is, \fB-h\fR) server:

.sp
.in +2
.nf
example% ldapsearch -u -h '['fec0::111:a00:20ff:fea3:edcf']' \e
              -t "uid=mcs" jpegPhoto audio
.fi
.in -2
.sp

.SH EXIT STATUS
.sp
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB>\fB0\fR\fR
.ad
.RS 6n
An error occurred. A diagnostic message is written to standard error.
.RE

.SH ATTRIBUTES
.sp
.LP
See \fBattributes\fR(5) for a description of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
Stability Level	Evolving
.TE

.SH SEE ALSO
.sp
.LP
\fBldapadd\fR(1), \fBldapdelete\fR(1), \fBldapmodify\fR(1),
\fBldapmodrdn\fR(1), \fBattributes\fR(5)