Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Technical Support _ Ldapsearh command is braking my balls!!!...not litterally

Posted by: cvs Jan 7 2014, 08:19 AM

ok so i need to search from a .txt file around 5000 numbers in a 1.2 gb data base so im usisng this command:

ldapsearch -h PL0 -x -D "cn=****************,dc=ok,dc=com" -w "***************" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI | grep 'IMSI: '

The idea is to print all the IMSI numbers that match my search how ever each time i try to run it it takes a lot of time and doesnt print anyting at all, then i tried to run it with only the ldap command and no grep

ldapsearch -h PL0 -x -D "cn=*********,dc=ok,dc=com" -w "********" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI

The command runs but shows the complete result and not only the imsi

# filter: IMSI=123456789101234
# 123456789101234, imsi, identities,
dn: IMSI=123456789101234,dc=imsi,ou=identities,dc=ok,dc=com

i tried to save the result in a file so i tried to run this

ldapsearch -h PL0 -x -D "cn=*******,dc=ok,dc=com" -w "*********" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI > results.txt

The results.txt file is run but the there is nothing saved inside it

Can anybody please explain me what am i doing wrong? why the grep from the first command is not running why is the file created "results.txt" but bothing is inside.

And why is the second command running ok and showing output but i cant save it.

I hope you guys here can help me


Posted by: Robert83 Aug 23 2014, 07:26 AM


the mistake is this :

ldapsearch -h PL0 -x -D "cn=****************,dc=ok,dc=com" -w "***************" -s one -b "dc=imsi,ou=identities,dc=ok,dc=com" IMSI=%s -f iphfives.txt IMSI | grep 'IMSI: '

grep 'IMSI: ' <----


grep IMSI , you don't Need ' '


Powered by Invision Power Board (
© Invision Power Services (