Imam al-Dhahabi (Allah have mercy on him) points out to the signs of having a sincere intention or otherwise, He mentions that the one who seeks knowledge for the sake of Allah Most High, then that knowledge creates in him humility, humbleness and the fear of Allah. And the one who seeks knowledge for worldly gains, he becomes proud with his knowledge, thus argues and quarrels with other Muslims. (See: al-Muqizah, p. 65.)