Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何为 LDAP 搜索制作一个 bourne shell 代码以不返回 DN 而只返回 CN?我为此使用 iTerm2。
如果您只想查看cn结果,则可以使用以下内容:
cn
ldapsearch -o ldif-wrap=no -L <blah> cn | grep '^cn:'
<blah>您的绑定/搜索条件在哪里
<blah>
它返回的原因dn是因为没有它,返回的数据将无法正确形成 ldif。
dn
通过使用-o ldif-wrap=no,您不必处理涉及返回数据的换行的问题。
-o ldif-wrap=no