The Prophet Muhammad صلى الله عليه وسلم said: "If anyone travels on a road in search of knowledge, Allah will cause him to travel on one of the roads of Paradise. The angels will lower their wings in their great pleasure with one who seeks knowledge. The inhabitants of the heavens and the Earth and (even) the fish in the deep waters will ask forgiveness for the learned man. The superiority of the learned over the devout is like that of the moon, on the night when it is full, over the rest of the stars. The learned are the heirs of the Prophets, and the Prophets leave (no monetary inheritance), they leave only knowledge, and he who takes it takes an abundant portion."
Sunan Abu Dawood