The following is an excerpt from Warathatu’I-Anbiya of shaykh Ibn Rajab al-Hanbali.
Among that which indicates the preference of seeking knowledge over voluntary worship is the fact that knowledge combines the virtues of all other acts of worship. Knowledge is the best form of dhikr, as has been explained. It is also the best form of struggle in the path of God.
The Prophet Muhammad (s.a.w) said , “The scholar’s ink will be weighted against the martyr’s blood and the scholar’s ink will prove weightier”.[al khatib, al tariqh al baghdad 2.193]
Prophet Muhammad (s.a.w) also said, “Whoever treads the path of knowledge, he is in the way of Allah until he returns.” [Appears in Tirmidhi].
Another hadith relates, “If death comes to the student he is a martyr.” [kashf al astar p.138]
Mu’adh ibn Jabal (r.a) relates from Abu Hurayra (r.a) who heard from Prophet Muhammad (s.a.w):
Acquire knowledge because doing so is good. Seeking it is worship.Reviewing it is glorifying Allah. Researching it is highest struggle in the path of God. Teaching it to the ignorant is charity. Serving the scholars is a way of drawing near to Allah because knowledge is the path of ascension to the stations of Paradise. It is a companion in isolation and a comrade in distant lands. It speaks to you in solitude. It is a guide to prosperity and a shield against adversity. It beautifies one among God conscious people and is a weapon against God ignorant people. With it Allah elevates people and makes them guides and bellwethers of good. The people of knowledge are people whose words are sought and whose actions are imitated. The angels long for their company and comfort them with their wings. Everything, the fish of the sea, the beasts of the earth, the predators of the land and sea, and the cattle pray that blessings come upon people of knowledge of God. This is because knowledge enlivens the heart against ignorance, illuminates the eyes against darkness, and strengthens the body. It transports the servant to the mansions of the select and the righteous and to the highest ranks in the world and in the Hereafter. Contemplating it is equivalent to fasting, and reviewing it is equivalent to the Night Prayer vigil. With it, kinship is united and the lawful is distinguished from the unlawful, knowledge is an imam which leads to righteous actions. It is craved by the people destined for Paradise and shunned by people destined for Hell. [Appears in al- Hilya of Abu Nu’aym 1.239]