ldapsearch -D cn=ldapadmin,dc=example,dc=com -w Y0ur4dm!nPwd -b dc=example,dc=com $* # Takes any number of arguments: atrib=value or '(filter)' # If no arguments specified, it perform `ldapsearch` without arguments and prints all the matching results