Having completed his studies, Imam Ghazali (Rehmatullahi ’Alaih) was en route back home. On the way the caravan in which he was travelling was waylaid by robbers. Together with his co-travellers, Imam Ghazali (Rehmatullahi ’Alaih) was dispossessed of all his goods. Amongst his possessions were the carefully written notes of the lectures delivered by his ustads. These notes were also taken by the robbers. Imam Ghazali (Rehmatullahi ’Alaih) sought out the leader of the band of robbers and pleaded with him: "Your men have taken all my possessions except for the clothes I wear. You may keep the extra clothes and other valuables - I do not lament their loss. However, please ask your men to return the papers they have taken."
The leader of the band of robbers was amazed at this unusual request. This young man was not worried about clothes and valuables, but he was asking for some pieces of paper to be returned!
Very curious, he asked: "What papers are these?"
Imam Ghazali (Rehmatullahi ’Alaih) explained: "I am a student returning home after completing my studies. When my teachers used to lecture, I used to make notes. These are those very pages of 'ilm that I am requesting to be returned to me."
The leader of the robbers said, "What you have just said fills me with great sorrow and regret. Young lad! Is your 'ilm on pieces of paper when it should have been in your heart? Papers can get lost. Papers can be destroyed by fire, become parched by the sun, get eaten by moths, become damaged with damp, etc., etc. You are dependent on papers? It fills me with great pity. Your 'ilm should be in your heart! Be that as it may, your papers will be returned."
He summoned one of his men and ordered him, "Give back to this boy his papers." The notes were retrieved and returned to Imam Ghazali (Rehmatullahi ’Alaih).
Imam Ghazali (Rehmatullahi ’Alaih) was of noble character. He was, moreover, a dedicated student. The words of the gang-leader were like a knife piercing his heart. On reaching home, he lost no time in memorising all his notes!
source: islamic forum/spreading the light of islam